class BufferStream : public MemStream
A Stream based on a Vector<byte> buffer, beeing able to open such a Vector<byte> to Loading or directly serializing to such a Vector.It automatically increases the underlying Vector. It uses _pick semantics to open a Vector<byte> and returns the underlying Vector<byte> as _pick (leaving a new instance under hood, so new buffering is possible as well)
void Open(Vector<byte> & d)
Picks the Vector d.as underlying buffer. doesnt change the current Stream mode, only updates the pointers od the Stream, resetting read position.
void Create()
resets underlying buffer and sets Stream to Storing mode. rewinds current ptr to beginning.
void Reserve(int n)
reserves additional n.bytes in the Stream. sets Storing mode.can speed up things if you know how much is to come.
void Crop()
crops the internal buffer to currently used size. if storing buffer, means crop
Vector<byte> GetResult()
picks internal Vector, leaving an initialized Vector for new operations.
BufferStream()
creates a BufferStream in Storing Mode
BufferStream(Vector<byte>& d)
Creates a BufferStream in Loading mode. Loads Vector d.picking it.
|