BinaryReader
sealed class BinaryReaderimport BinaryReader from Wax;A cursor over a supplied byte array, with explicitly selected little- or big-endian numeric decoding. The array is retained, not copied, so later writes through another alias are visible. Positions and lengths are bytes. Insufficient data panics; seeks and skips clamp to the available range.
Inherits from object. Follow these links for inherited members.
Members
LittleEndianconstructor
public constructor LittleEndian (uint8[] data)Creates a little-endian cursor at byte position zero.
BigEndianconstructor
public constructor BigEndian (uint8[] data)Creates a big-endian cursor at byte position zero.
positiongetter
public get position() : int32The current zero-based byte offset.
remaininggetter
public get remaining() : int32The number of unread bytes from the current position to the end.
lengthgetter
public get length() : int32The number of bytes in the backing data.
Seekmethod
public fn Seek(int32 offset) : voidMoves to an absolute byte offset, clamped to [0, length].
Skipmethod
public fn Skip(int32 count) : voidMoves by a signed byte count, clamped to [0, length]; negative counts move backward.
Resetmethod
public fn Reset() : voidMoves the cursor to byte zero without clearing or changing the backing data.
Readmethod
public fn Read<T>() : T where T is numericReads sizeof(T) bytes in the selected byte order and advances the cursor. Panics if the
whole value is unavailable, before advancing.
ReadAtmethod
public fn ReadAt<T>(int32 offset) : T where T is numericReads sizeof(T) bytes at an absolute offset without moving the cursor. Negative or
insufficient ranges panic.