LayoutByteReader class
Read-only cursor over an immutable byte buffer used by layout decoders.
Constructors
-
LayoutByteReader(List<
int> bytes) -
Wraps
bytesas an immutable buffer. - LayoutByteReader.write(BuBytes _bytes)
- Wraps an already-immutable buffer without copying.
Properties
- bytes → BuBytes
-
The underlying immutable byte buffer.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- last → int
-
The last byte in the buffer.
no setter
- length → int
-
Total number of bytes in the buffer.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
at(
int index) → int -
Returns the byte at
index. -
decodeScale(
int offset) → LayoutDecodeResult< BigInt> -
Decodes a SCALE-encoded compact integer at
offsetas a BigInt. -
decodeScaleAsInteger(
int offset) → LayoutDecodeResult< int> -
Decodes a SCALE-encoded compact integer at
offsetas a Dart int. -
decodeVarintAsInteger(
int offset) → LayoutDecodeResult< int> -
Decodes a varint at
offsetas a Dart int. -
getScaleLength(
int offset) → int -
Number of bytes the SCALE header at
offsetoccupies. -
getU16Be(
int index) → int -
Reads a big-endian unsigned 16-bit integer starting at
index. -
getU32Be(
int index) → int -
Reads a big-endian unsigned 32-bit integer starting at
index. -
getU64Be(
int i) → BigInt -
Reads a big-endian unsigned 64-bit integer starting at
i. -
getU8(
int index) → int -
Reads an unsigned 8-bit integer at
index. -
getVarintLength(
int offset) → int -
Number of bytes the varint header at
offsetoccupies. -
isEnd(
int offset) → bool -
Whether
offsethas reached the end of the buffer. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requireAvailable(
int offset, int length) → void -
Throws
LayoutExceptionunlesslengthbytes starting atoffsetare available. Fixed-span decodes call this first so short reads fail asLayoutExceptioninstead of leaking raw range errors from the byte utilities underneath. -
sublist(
int start, int end) → BuBytes -
Returns the byte range
[start, end). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited