00001 #ifndef CLASSLIB_BUFFER_INPUT_STREAM_H 00002 # define CLASSLIB_BUFFER_INPUT_STREAM_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/iotools/FilterInputStream.h" 00007 00008 namespace lat { 00009 //<<<<<< PUBLIC DEFINES >>>>>> 00010 //<<<<<< PUBLIC CONSTANTS >>>>>> 00011 //<<<<<< PUBLIC TYPES >>>>>> 00012 //<<<<<< PUBLIC VARIABLES >>>>>> 00013 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00014 //<<<<<< CLASS DECLARATIONS >>>>>> 00015 00016 class BufferInputStream : public FilterInputStream 00017 { 00018 public: 00019 BufferInputStream (InputStream *input, IOSize bufsize = 0); 00020 ~BufferInputStream (void); 00021 00022 using FilterInputStream::read; 00023 virtual IOSize available (void); 00024 virtual IOSize read (void *into, IOSize n); 00025 virtual IOSize skip (IOSize n); 00026 virtual void close (void); 00027 virtual void reset (void); 00028 00029 protected: 00030 unsigned char *m_buffer; 00031 unsigned char *m_bottom; 00032 unsigned char *m_top; 00033 unsigned char *m_limit; 00034 }; 00035 00036 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00037 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00038 00039 } // namespace lat 00040 #endif // CLASSLIB_BUFFER_INPUT_STREAM_H