Provides possibility to work with memory buffer through a Simple_Stream interface. Please note that Read and Write operations both increment internal pointer (in the same way as file operations). If the end of buffer is reached operations will not fail - only return less bytes (or zero) than required by Read or Write. More...
#include <Memory_Stream.h>
Public Member Functions | |
Memory_Stream (T *buf, size_t size) | |
Constructs Memory_Stream from provided memory buffer of given size. | |
int | Read (T *buf, size_t len, size_t *read) |
Reads a number of T values from stream. | |
int | Write (T *buf, size_t len, size_t *written) |
Writes a number of T values to stream. | |
int | Flush () |
Flushes the internal buffer, useful when you need to make sure the data is passed to the Stream backend (could be some file) from Stream internal buffer. |
Provides possibility to work with memory buffer through a Simple_Stream interface. Please note that Read and Write operations both increment internal pointer (in the same way as file operations). If the end of buffer is reached operations will not fail - only return less bytes (or zero) than required by Read or Write.