|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||
#include "ot/io/SequenceInputStream.h"

InputStreams may be added to the contained sequence until this SequenceInputStream is closed.
This class follows the OpenTop convention whereby the reference-counts for the contained InputStream objects are incremented when they are stored in the internal sequence and decremented on removal. In this way the application does not need to concern itself with maintaining the lifetime of InputStreams stored within this sequence.
| Constructor/Destructor Summary | |
SequenceInputStream()Constructs an empty SequenceInputStream. | |
SequenceInputStream(const InputStreamList& seq)Constructs a SequenceInputStream from a passed sequence (which may be empty). | |
SequenceInputStream(InputStream* pStream)Constructs a SequenceInputStream from another InputStream. | |
SequenceInputStream(InputStream* pStream1, InputStream* pStream2)Constructs a SequenceInputStream from two InputStreams. | |
| Method Summary | |
void |
addStream(InputStream* pStream)Adds an InputStream to the end of the contained sequence. |
virtual size_t |
available()Returns the number of bytes that can be read without blocking. |
virtual void |
close()Closes the InputStream. |
virtual long |
read(Byte* pBuffer, size_t bufLen)Reads up to bufLen bytes into the supplied buffer. |
| Methods inherited from class ot::io::InputStream |
mark(size_t), markSupported(), read(), reset(), skip(size_t) |
| Methods inherited from class ot::ManagedObject |
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release() |
| Typedefs |
typedef std::list< RefPtr< InputStream > > InputStreamList
| Constructor/Destructor Detail |
SequenceInputStream()
SequenceInputStream(const InputStreamList& seq)
seq - SequenceInputStream(InputStream* pStream)
pStream - NullPointerException - SequenceInputStream(InputStream* pStream1,
InputStream* pStream2)
pStream1 - pStream2 - NullPointerException - | Method Detail |
void addStream(InputStream* pStream)
NullPointerException - IOException - 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 - virtual long read(Byte* pBuffer,
size_t bufLen)
pBuffer - bufLen - IllegalArgumentException - NullPointerException - IOException -
|
OpenTop 1.5 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||||
| SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD | |||||||