BinaryReader

Reads binary encoded data.

Constructors

this
this(ref Range source, ByteOrder byteOrder = ByteOrder.Native)

Creates instance of BinaryReader.

Members

Functions

clear
void clear()

Clears source range and position.

empty
bool empty()

Determines if input stream is empty.

position
ulong position()

Gets current position in stream.

read
void read(ref T value)

Reads specified value from input stream.

read
T read()

Reads T type from stream and returns it.

read
void read(ref T values)

Reads specified values from input stream.

readArray
void readArray(ref T[] arr, size_t length)

Reads array with length elements.

readArray
T[] readArray(size_t num)

Reads array of type T with num elemetns and returns it.

readBytes
ubyte[] readBytes(size_t bytes)

Reads array of bytes from input stream.

readString
void readString(ref T str)

Reads string into str.

readString
string readString()

Reads string and returns it.

readUntil
ubyte[] readUntil(ubyte stop, bool next = true)

Reads bytes until stop is found.

skipBytes
void skipBytes(size_t num)

Skips num bytes from source.

skipTo
void skipTo(size_t offset)

Moves cursor to specified position.

source
void source(ref Range source)

Sets new source range to read from.

source
Range source()

Gets source range used.

source
void source(Range source)

Sets new source range to read from.

Variables

byteOrder
ByteOrder byteOrder;

Used byte order

Meta