MemoryDataStream
Description
- Derived from
-
DataStreamBase abstract
IInternalBuffer<ByteBuffer>
IMemoryConsumption
An implementation of the IDataStream that uses a growing memory buffer.
Public / Constructors
For
3 overloads
Creates a new instance of MemoryDataStream that reads the given data.
The stream will be in read mode.
Creates a new instance of MemoryDataStream that reads the given data.
The stream will be in read mode.
Creates a new instance of MemoryDataStream that reads the given data.
The stream will be in read mode.
MemoryDataStream
Creates a new instance of MemoryDataStream.
The stream will be in write mode.
- See also
Wrap
Creates a new instance of MemoryDataStream that reads the given data.
The stream will be in read mode.
Public / Methods
Clear
Clears this memory stream so that it can be used again for writing.
After returning, the stream will be in write mode.
CreatePool
Creates an object pool for MemoryDataStream objects of the given size.
Each MemoryDataStream object that is returned by the object pool will already have its state reset via Clear.
Flip
Flips this memory stream so that it reads back the data that has been written to it.
When calling this method, the stream must be in write mode. After returning, the stream will be in read mode.
- IOException
-
If this memory stream is not in write mode.
- See also
ToBuffer
Returns the current content of this memory stream.
When calling this method, the stream must be in write mode. The stream state is not modified by this method.
- IOException
-
If the memory stream is not in write mode.
- See also
WriteChunk
Prepares the internal buffer of this memory stream for writing a chunk of bytes.
- IOException
-
If the memory stream is not in write mode.