|
| | CMemoryStream (unsigned int initMem=512) |
| | Create an owning memory stream.
|
| | CMemoryStream (unsigned char *fromMem, unsigned int size) |
| | Wrap an existing memory block for reading or fixed-size writing.
|
| | CMemoryStream (const CMemoryStream &stream) |
| | Copy a stream into a new backing buffer.
|
|
virtual | ~CMemoryStream () |
| | Destroy the stream and release owned memory.
|
| bool | autoGrow (unsigned int writeSize) |
| | Ensure the stream has enough capacity for an upcoming write.
|
| void | writeData (const void *data, unsigned int size) |
| | Append raw bytes to the stream.
|
| void | writeStream (CMemoryStream *stream) |
| | Append the full contents of another memory stream.
|
|
void | writeChar (char data) |
| | Append a signed 8-bit character.
|
|
void | writeShort (short data) |
| | Append a signed 16-bit integer.
|
|
void | writeUShort (unsigned short data) |
| | Append an unsigned 16-bit integer.
|
|
void | writeInt (int data) |
| | Append a signed 32-bit integer.
|
|
void | writeUInt (unsigned int data) |
| | Append an unsigned 32-bit integer.
|
|
void | writeFloat (float data) |
| | Append a 32-bit floating-point value.
|
|
void | writeDouble (double data) |
| | Append a 64-bit floating-point value.
|
|
void | writeString (const std::string &s) |
| | Append a UTF-8/narrow string with its character count prefix.
|
|
void | writeString (const std::wstring &s) |
| | Append a wide string with its character count prefix.
|
| void | writeFloatArray (const float *f, int count) |
| | Append an array of floats.
|
| unsigned int | readData (void *data, unsigned int size) |
| | Read raw bytes from the current read position.
|
|
char | readChar () |
| | Read a signed 8-bit character and advance the read position.
|
|
short | readShort () |
| | Read a signed 16-bit integer and advance the read position.
|
|
unsigned short | readUShort () |
| | Read an unsigned 16-bit integer and advance the read position.
|
|
int | readInt () |
| | Read a signed 32-bit integer and advance the read position.
|
|
unsigned int | readUInt () |
| | Read an unsigned 32-bit integer and advance the read position.
|
|
float | readFloat () |
| | Read a 32-bit floating-point value and advance the read position.
|
|
double | readDouble () |
| | Read a 64-bit floating-point value and advance the read position.
|
|
std::string | readString () |
| | Read a narrow string written by writeString(const std::string&).
|
|
std::wstring | readWString () |
| | Read a wide string written by writeString(const std::wstring&).
|
| void | readFloatArray (float *f, int count) |
| | Read an array of floats and advance the read position.
|
| unsigned char * | getData () |
| | Get the backing memory pointer.
|
| unsigned int | getSize () |
| | Get the number of bytes written or available for reading.
|
| unsigned int | getPos () |
| | Get the current read position.
|
| unsigned int | getTotalSize () |
| | Get the total allocated capacity.
|
| void | setPos (unsigned int pos) |
| | Set the current read position.
|
|
void | resetWrite () |
| | Clear written data and reset the read position.
|
| void | encrypt () |
| | Encrypt the stream contents.
|
| void | decrypt () |
| | Decrypt the stream contents.
|
In-memory byte stream for binary serialization and deserialization.
A stream can own its backing buffer or wrap an external memory block. Streams created from external memory cannot grow automatically.