67 std::memcpy(dataPtr,
_ptr, dataSize);
78 const size_t oldPos =
_pos;
110 bool bigEndian,
bool disposeMemory) :
MemoryReadStreamEndian(const byte *dataPtr, size_t dataSize, bool bigEndian=false, bool disposeMemory=false)
Implementing the reading stream interfaces for plain memory blocks.
~MemoryReadStreamEndian()
DisposableArray< const byte > _ptrOrig
size_t seek(ptrdiff_t offset, Origin whence=kOriginBegin)
Sets the stream position indicator for the stream.
Origin
The position a seeking offset takes as a base.
Basic exceptions to throw.
const byte * getData() const
Utility templates and functions.
bool eos() const
Returns true if a read failed because the stream has been reached.
Simple memory based 'stream', which implements the ReadStream interface for a plain memory block...
const Exception kSeekError("Seek error")
Exception when seeking a stream failed.
static size_t evalSeek(ptrdiff_t offset, Origin whence, size_t pos, size_t begin, size_t size)
Evaluate the seek offset relative to whence into a position from the beginning.
size_t size() const
Obtains the total size of the stream, measured in bytes.
PointerType get() const
Returns the plain pointer value.
size_t pos() const
Obtains the current value of the stream position indicator of the stream.
size_t read(void *dataPtr, size_t dataSize)
Read data from the stream.