47 MemoryStream(std::shared_ptr<std::vector<char>> buffer,
size_t offset);
67 std::unique_ptr<char[]>
Read(
size_t length)
override;
74 void Read(
char* dest,
size_t length)
override;
94 void Write(
char* srcBuffer,
size_t length)
override;
A Stream backed by an in-memory byte buffer.
Definition MemoryStream.h:20
std::size_t mBufferSize
Fixed size (0 if growable).
Definition MemoryStream.h:115
MemoryStream(std::shared_ptr< std::vector< char > > buffer)
Constructs a memory stream over a shared vector, positioned at the start.
void Read(char *dest, size_t length) override
Reads length bytes into dest from the current position.
uint64_t GetLength() override
Returns the total number of bytes in the backing buffer.
void Seek(int32_t offset, SeekOffsetType seekType) override
Moves the current position within the backing buffer.
std::shared_ptr< std::vector< char > > mBuffer
Shared backing store.
Definition MemoryStream.h:114
void WriteByte(int8_t value) override
Writes a single signed byte at the current position.
void Flush() override
No-op for in-memory streams; included for interface compliance.
MemoryStream(char *nBuffer, size_t nBufferSize)
Constructs a memory stream by copying a raw byte buffer.
std::vector< char > ToVector() override
Returns a copy of the entire backing buffer as a vector.
void Close() override
No-op for in-memory streams; the buffer remains valid after closing.
std::unique_ptr< char[]> Read(size_t length) override
Reads length bytes starting at the current position.
void Write(char *srcBuffer, size_t length) override
Writes length bytes from srcBuffer at the current position.
MemoryStream(std::shared_ptr< std::vector< char > > buffer, size_t offset)
Constructs a memory stream over a shared vector at a given byte offset.
int8_t ReadByte() override
Reads a single signed byte and advances the position by one.
MemoryStream()
Constructs an empty, growable memory stream.
Abstract base class for sequential byte streams (read/write).
Definition Stream.h:26
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
SeekOffsetType
Identifies the reference point for a seek operation.
Definition Stream.h:10