ByteStream class

Byte stream utility class for decoding.

Provides sequential reading operations on byte arrays with position tracking.

Constructors

ByteStream(Uint8List data)
Constructs a ByteStream from the given data.

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
Gets the total length of the byte stream.
no setter
readLength int
Gets the number of bytes that have been read so far.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unreadLength int
Gets the number of bytes remaining to be read.
no setter

Methods

checkBytesAvailable(int number) → void
Checks if number bytes are available in the stream.
checkEmpty() → void
Checks if the stream is empty (all bytes have been read).
isEnd() bool
Checks if the stream has reached the end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readAll() Uint8List
Reads all remaining bytes from the stream.
readBigInt(int number, {Endianness endianness = Endianness.Big}) BigInt
Reads number bytes and converts them to a BigInt with the specified endianness.
readByte() int
Reads and returns a single byte from the stream.
readBytes(int number) Uint8List
Reads and returns number bytes from the stream.
readHexString(int number) String
Reads number bytes and converts them to a hex string.
readInt(int number, {Endianness endianness = Endianness.Big}) int
Reads number bytes and converts them to an integer with the specified endianness.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited