DCL 3.7.4
Loading...
Searching...
No Matches
FileOutputStream Class Reference

#include <FileOutputStream.h>

Inheritance diagram for FileOutputStream:
OutputStream Object XFileOutputStream

Protected Member Functions

void init (File *_file) __DCL_THROWS1(IOException *)
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Protected Attributes

File__file
bool __closeDestroy
byte_t__buf
size_t __bufSize
size_t __dataSize

Additional Inherited Members

Public Member Functions inherited from Object
virtual String toString () const
virtual void destroy ()
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Detailed Description

파일에 바이트 스트림을 출력한다. UNIX 운영체제에서 파일이 블록 장치이면 블록의 크기 단위로 버퍼링을 하여 출력하고, 그 외에는 4096바이트 단위로 버퍼링을 한다.

Author
Daejung Kim
Since
DCL Version 1.0
See also
File

Definition at line 23 of file FileOutputStream.h.

Member Function Documentation

◆ init()

void FileOutputStream::init ( File * _file)
protected

블록장치 여부를 확인하고, 출력버퍼의 크기를 설정한다.

Definition at line 48 of file FileOutputStream.cpp.

50{
51 __buf = NULL;
52 __bufSize = 0;
53#ifdef __WINNT__
54 switch (_file->fileType()) {
55 case File::REGULAR: {
56 __bufSize = 4096;
57 break;
58 }
59 case File::PIPE: {
60 DWORD dwOutBufferSize = 0;
61 if (GetNamedPipeInfo(_file->handle(), NULL, &dwOutBufferSize, NULL, NULL)) {
62 __bufSize = dwOutBufferSize;
63 }
64 break;
65 }
66 default: {
67 // __bufSize = 0;
68 }
69 }
70#else
71 if (!isatty(_file->handle())) {
72 struct stat st;
73 if (fstat(_file->handle(), &st)) {
74 throw new IOException(_file->path(), errno);
75 }
76 __bufSize = st.st_blksize;
77 }
78#endif
79 __dataSize = 0;
80}
#define NULL
Definition Config.h:312
HandleType handle() const
Definition File.h:246
const String & path() const
Definition File.h:251

Member Data Documentation

◆ __buf

byte_t* FileOutputStream::__buf
protected

Definition at line 106 of file FileOutputStream.h.

◆ __bufSize

size_t FileOutputStream::__bufSize
protected

Definition at line 107 of file FileOutputStream.h.

◆ __closeDestroy

bool FileOutputStream::__closeDestroy
protected

Definition at line 104 of file FileOutputStream.h.

◆ __dataSize

size_t FileOutputStream::__dataSize
protected

Definition at line 108 of file FileOutputStream.h.

◆ __file

File* FileOutputStream::__file
protected

Definition at line 103 of file FileOutputStream.h.


The documentation for this class was generated from the following files: