API for implementing a buffered stream.
Functions | |
ReadStream * | Common::wrapBufferedReadStream (ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream) |
SeekableReadStream * | Common::wrapBufferedSeekableReadStream (SeekableReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream) |
SeekableWriteStream * | Common::wrapBufferedWriteStream (SeekableWriteStream *parentStream, uint32 bufSize) |
WriteStream * | Common::wrapBufferedWriteStream (WriteStream *parentStream, uint32 bufSize) |
ReadStream* Common::wrapBufferedReadStream | ( | ReadStream * | parentStream, |
uint32 | bufSize, | ||
DisposeAfterUse::Flag | disposeParentStream | ||
) |
Take an arbitrary ReadStream and wrap it in a custom stream that transparently provides buffering. You can specify how big the buffer should be, and whether the wrapped stream should be disposed when the wrapper is disposed.
It is safe to call this with a NULL parameter (in this case, NULL is returned).
parentStream | The ReadStream to wrap in a custom stream. |
bufSize | Size of the buffer. |
disposeParentStream | Flag indicating whether to dispose of the wrapped stream. |
SeekableReadStream* Common::wrapBufferedSeekableReadStream | ( | SeekableReadStream * | parentStream, |
uint32 | bufSize, | ||
DisposeAfterUse::Flag | disposeParentStream | ||
) |
Take an arbitrary SeekableReadStream and wrap it in a custom stream that transparently provides buffering. You can specify how big the buffer should be, and whether the wrapped stream should be disposed when the wrapper is disposed.
It is safe to call this with a NULL parameter (in this case, NULL is returned).
parentStream | The SeekableReadStream to wrap in a custom stream. |
bufSize | Size of the buffer. |
disposeParentStream | Flag indicating whether to dispose of the wrapped stream. |
SeekableWriteStream* Common::wrapBufferedWriteStream | ( | SeekableWriteStream * | parentStream, |
uint32 | bufSize | ||
) |
Take an arbitrary WriteStream and wrap it in a custom stream that transparently provides buffering. You can specify how big the buffer should be. Currently, the parent stream is always disposed when the wrapper is disposed.
It is safe to call this with a NULL parameter (in this case, NULL is returned).
parentStream | The WriteStream to wrap in a custom stream. |
bufSize | Size of the buffer. |