← Standard library

BinaryReader

sealed class BinaryReader
import 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.

BinaryReader.wax:16

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.

BinaryReader.wax:24

BigEndianconstructor

public constructor BigEndian (uint8[] data)

Creates a big-endian cursor at byte position zero.

BinaryReader.wax:33

positiongetter

public get position() : int32

The current zero-based byte offset.

BinaryReader.wax:42

remaininggetter

public get remaining() : int32

The number of unread bytes from the current position to the end.

BinaryReader.wax:46

lengthgetter

public get length() : int32

The number of bytes in the backing data.

BinaryReader.wax:50

Seekmethod

public fn Seek(int32 offset) : void

Moves to an absolute byte offset, clamped to [0, length].

BinaryReader.wax:55

Skipmethod

public fn Skip(int32 count) : void

Moves by a signed byte count, clamped to [0, length]; negative counts move backward.

BinaryReader.wax:64

Resetmethod

public fn Reset() : void

Moves the cursor to byte zero without clearing or changing the backing data.

BinaryReader.wax:74

Readmethod

public fn Read<T>() : T where T is numeric

Reads sizeof(T) bytes in the selected byte order and advances the cursor. Panics if the whole value is unavailable, before advancing.

BinaryReader.wax:80

ReadAtmethod

public fn ReadAt<T>(int32 offset) : T where T is numeric

Reads sizeof(T) bytes at an absolute offset without moving the cursor. Negative or insufficient ranges panic.

BinaryReader.wax:95