|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |
#include "ot/io/FilterInputStream.h"
The FilterInputStream class overrides all methods of InputStream with versions that pass requests to the contained input stream. Derived classes of FilterInputStream are expected to further override some of these methods to perform some useful function before the data is returned to the caller (which may be yet another FilterInputStream).
Constructor/Destructor Summary | |
FilterInputStream(InputStream* pInputStream) Constructs a FilterInputStream using pInputStream as the contained input stream. |
Method Summary | |
virtual size_t |
available() Returns the number of bytes that can be read without blocking. |
virtual void |
close() Closes the InputStream. |
protected RefPtr< InputStream > |
getInputStream() const Returns the contained input stream. |
virtual void |
mark(size_t readLimit) Marks the current position in the byte stream. |
virtual bool |
markSupported() const Tests whether the InputStream supports the mark() operation. |
virtual int |
read() Reads and returns a single Byte or InputStream::EndOfFile. |
virtual long |
read(Byte* pBuffer, size_t bufLen) Reads up to bufLen bytes into the supplied buffer. |
virtual void |
reset() Resets the position in the byte stream to a previously marked position. |
virtual size_t |
skip(size_t n) Reads and discards n bytes. |
Methods inherited from class ot::ManagedObject |
addRef, getRefCount, onFinalRelease, operator=, release |
Constructor/Destructor Detail |
protected FilterInputStream(InputStream* pInputStream)
NullPointerException
- Method Detail |
virtual size_t available()
Note, however, that the utility of this function is severely limited. Some sub-classes (e.g. FileInputStream) always return zero from available() and zero is also returned when the stream is at the end. For these reasons, it is rarely appropriate for an application to loop waiting for a positive return value from available().
IOException
- virtual void close()
IOException
- protected RefPtr< InputStream > getInputStream() const
virtual void mark(size_t readLimit)
Supporting mark() implies that the InputStream must maintain an internal buffer containing all the bytes read from the point at which mark() was called. The size of this buffer is implementation dependent, but is guaranteed to hold at least readLimit bytes before it becomes full. When the buffer limit is exceeded, the marked position is automatically invalidated, with the result that subsequent reset() operations will fail.
Only one mark position is maintained by the InputStream. Further calls to mark() will establish a new mark position; reset() can only reset the position to the most recently established mark position.
readLimit
- IOException
- IOException
- virtual bool markSupported() const
virtual int read()
IOException
- virtual long read(Byte* pBuffer, size_t bufLen)
pBuffer
- bufLen
- IllegalArgumentException
- NullPointerException
- IOException
- virtual void reset()
IOException
- IOException
- IOException
- virtual size_t skip(size_t n)
n
- IOException
-
|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |