52 virtual std::unique_ptr<char[]>
Read(
size_t length) = 0;
59 virtual void Read(
char* dest,
size_t length) = 0;
75 virtual void Write(
char* destBuffer,
size_t length) = 0;
Abstract base class for sequential byte streams (read/write).
Definition Stream.h:26
virtual void Seek(int32_t offset, SeekOffsetType seekType)=0
Moves the stream position.
virtual void Close()=0
Closes the stream and releases any held resources.
virtual void WriteByte(int8_t value)=0
Writes a single byte at the current position.
virtual int8_t ReadByte()=0
Reads a single byte from the current position.
virtual std::unique_ptr< char[]> Read(size_t length)=0
Reads length bytes from the current position and advances the position.
virtual uint64_t GetLength()=0
Returns the total length of the stream in bytes.
uint64_t mBaseAddress
Current read/write position (byte offset from the start).
Definition Stream.h:99
uint64_t GetBaseAddress()
Returns the current stream position as an absolute byte offset.
virtual ~Stream()=default
virtual void Read(char *dest, size_t length)=0
Reads length bytes from the current position into a caller-supplied buffer.
virtual void Write(char *destBuffer, size_t length)=0
Writes length bytes from destBuffer at the current position.
virtual std::vector< char > ToVector()=0
Returns the full stream contents as a std::vector<char>.
virtual void Flush()=0
Flushes any buffered writes to the underlying storage.
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
@ Current
Seek relative to the current position.