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

#include <FileOutputStream.h>

Inheritance diagram for FileOutputStream:
OutputStream Object XFileOutputStream

Protected Member Functions

void init (File *_pFile) __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 * _pFile)
protected

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

Definition at line 48 of file FileOutputStream.cpp.

50{
51 __buf = NULL;
52 __bufSize = 0;
53#if __DCL_WINDOWS
54 switch (_pFile->fileType())
55 {
56 case File::REGULAR:
57 __bufSize = 4096;
58 break;
59 case File::PIPE:
60 {
61 DWORD dwOutBufferSize = 0;
62 if (GetNamedPipeInfo(_pFile->handle(), NULL, &dwOutBufferSize, NULL, NULL))
63 __bufSize = dwOutBufferSize;
64 }
65 break;
66 }
67#else
68 struct stat st;
69 if (fstat(_pFile->handle(), &st)) // = -1
70 throw new IOException(_pFile->path(), errno);
71 if (S_ISBLK(st.st_mode))
72 __bufSize = st.st_blksize;
73
74#endif
75 __dataSize = 0;
76}
#define NULL
Definition Config.h:340
HandleType handle() const
Definition File.h:242
const String & path() const
Definition File.h:247

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: