ScummVM API documentation
Buffered stream

Description

API for implementing a buffered stream.

Functions

ReadStreamCommon::wrapBufferedReadStream (ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream)
 
SeekableReadStreamCommon::wrapBufferedSeekableReadStream (SeekableReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream)
 
SeekableWriteStreamCommon::wrapBufferedWriteStream (SeekableWriteStream *parentStream, uint32 bufSize)
 
WriteStreamCommon::wrapBufferedWriteStream (WriteStream *parentStream, uint32 bufSize)
 

Function Documentation

◆ wrapBufferedReadStream()

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).

Parameters
parentStreamThe ReadStream to wrap in a custom stream.
bufSizeSize of the buffer.
disposeParentStreamFlag indicating whether to dispose of the wrapped stream.

◆ wrapBufferedSeekableReadStream()

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).

Parameters
parentStreamThe SeekableReadStream to wrap in a custom stream.
bufSizeSize of the buffer.
disposeParentStreamFlag indicating whether to dispose of the wrapped stream.

◆ wrapBufferedWriteStream()

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).

Parameters
parentStreamThe WriteStream to wrap in a custom stream.
bufSizeSize of the buffer.