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

#include <FileInputStream.h>

Inheritance diagram for FileInputStream:
InputStream Object

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
const byte_t__cacheStart
size_t __cacheSize

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

파일로부터 바이트 스트림을 읽는다. 파일이 블록 장치이면 블록의 크기 단위로 입력 버퍼가 설정된다.

Author
Daejung Kim
Since
DCL Version 1.0
See also
File

Definition at line 22 of file FileInputStream.h.

Member Function Documentation

◆ __DCL_THROWS1()

FileInputStream::__DCL_THROWS1 ( IOException * )
protected

◆ init()

void FileInputStream::init ( File * _pFile)
protected

Definition at line 55 of file FileInputStream.cpp.

57{
58 __buf = NULL;
59 __bufSize = 0;
60#if __DCL_WINDOWS
61 switch (_pFile->fileType())
62 {
63 case File::REGULAR:
64 __bufSize = 4096;
65 break;
66#if 0
67 case File::PIPE:
68 {
69 DWORD dwInBufferSize = 0;
70 if (GetNamedPipeInfo(_pFile->handle(), NULL, NULL, &dwInBufferSize, NULL))
71 __bufSize = dwInBufferSize;
72 }
73 break;
74#endif
75 }
76
77#else
78 struct stat st;
79 if (fstat(_pFile->handle(), &st)) // = -1
80 throw new IOException(__file->path(), errno);
81 if (S_ISBLK(st.st_mode))
82 __bufSize = st.st_blksize;
83
84#endif
86 __cacheSize = 0;
87}
#define NULL
Definition Config.h:340
HandleType handle() const
Definition File.h:242
const byte_t * __cacheStart

Member Data Documentation

◆ __buf

byte_t* FileInputStream::__buf
protected

Definition at line 103 of file FileInputStream.h.

◆ __bufSize

size_t FileInputStream::__bufSize
protected

Definition at line 104 of file FileInputStream.h.

◆ __cacheSize

size_t FileInputStream::__cacheSize
protected

Definition at line 106 of file FileInputStream.h.

◆ __cacheStart

const byte_t* FileInputStream::__cacheStart
protected

Definition at line 105 of file FileInputStream.h.

◆ __closeDestroy

bool FileInputStream::__closeDestroy
protected

Definition at line 101 of file FileInputStream.h.

◆ __file

File* FileInputStream::__file
protected

Definition at line 100 of file FileInputStream.h.


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