openMSX
|
This class is complementary to the OutputBuffer class. More...
#include <SerializeBuffer.hh>
Public Member Functions | |
InputBuffer (const uint8_t *data, size_t size) | |
Construct new InputBuffer, typically the data and size parameters will come from a MemBuffer object. More... | |
void | read (void *result, size_t len) |
Read the given number of bytes. More... | |
void | skip (size_t len) |
Skip the given number of bytes. More... | |
const uint8_t * | getCurrentPos () const |
Return a pointer to the current position in the buffer. More... | |
This class is complementary to the OutputBuffer class.
Instead of filling an initially empty buffer it starts from a filled buffer and allows to retrieve items starting from the start of the buffer.
Definition at line 176 of file SerializeBuffer.hh.
openmsx::InputBuffer::InputBuffer | ( | const uint8_t * | data, |
size_t | size | ||
) |
Construct new InputBuffer, typically the data and size parameters will come from a MemBuffer object.
Definition at line 97 of file SerializeBuffer.cc.
References utf8::unchecked::size().
|
inline |
Return a pointer to the current position in the buffer.
This is useful if you don't want to copy the data, but e.g. use it as input for an uncompress algorithm. You can later use skip() to actually consume the data.
Definition at line 210 of file SerializeBuffer.hh.
Referenced by openmsx::MemInputArchive::loadStr(), and openmsx::MemInputArchive::serialize_blob().
|
inline |
Read the given number of bytes.
This 'consumes' the read bytes, so a future read() will continue where this read stopped.
Definition at line 188 of file SerializeBuffer.hh.
Referenced by openmsx::MemInputArchive::serialize().
|
inline |
Skip the given number of bytes.
This is similar to a read(), but it will only consume the data, not copy it.
Definition at line 199 of file SerializeBuffer.hh.
Referenced by openmsx::MemInputArchive::loadStr(), and openmsx::MemInputArchive::serialize_blob().