RecordReader class
Streaming binary reader for @HybridRecord types (web edge).
Counterpart to RecordWriter. Wraps framed bytes copied out of the WASM module heap.
- Inheritance
-
- Object
- RecordReaderBase
- RecordReader
Constructors
- RecordReader.fromFramedBytes(Uint8List framed, [int payloadOffset = 0])
-
Wraps framed bytes (
[4B len][payload]) without further copying, optionally positioned atpayloadOffsetwithin the payload. - RecordReader.fromPayload(Uint8List payload, [int pos = 0])
-
Positions the reader at
poswithin an unframed payload.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
lendBytes(
int offset, int length, int alignment) → Uint8List? -
lengthpayload bytes atoffset, at an address that is a multiple ofalignment, without copying into the Dart heap and kept alive for as long as the returned list is; or null to have them copied. Only a reader that owns its buffer can lend; this one does not.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBlob(
) → Uint8List -
inherited
-
readBlobView(
[int alignment = 1]) → Uint8List -
The bytes of a typed-data field the caller keeps. Copies like readBlob,
unless the reader owns the buffer under its payload and can lend them
(lendBytes).
alignmentis the element size of the list the caller builds on the result (Float32List.view(r.readBlobView(4).buffer)).inherited -
readBool(
) → bool -
inherited
-
readBoolList(
) → List< bool> -
inherited
-
readDouble(
) → double -
inherited
-
readDoubleList(
) → List< double> -
inherited
-
readFloat64(
) → double -
inherited
-
readInt(
) → int -
inherited
-
readInt32(
) → int -
inherited
-
readInt64(
) → int -
inherited
-
readInt8(
) → int -
inherited
-
readIntList(
) → List< int> -
inherited
-
readNullTag(
) → bool -
Returns
trueif the next value is null (tag byte == 0).inherited -
readString(
) → String -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decodeIndexedListBytes<
T> (Uint8List framed, T readItem(RecordReader r)) → List< T> -
Decodes an indexed list (
[4B count][8B×n offsets][items]) eagerly. -
decodeListBytes<
T> (Uint8List framed, T readItem(RecordReader r)) → List< T> - Decodes a list of @HybridRecord objects from framed bytes.
-
decodeNullableListBytes<
T> (Uint8List framed, T readItem(RecordReader r)) → List< T?> - Decodes a list of nullable items from framed bytes.
-
decodePrimitiveListBytes<
T> (Uint8List framed, T readItem(RecordReader r)) → List< T> - Decodes a list of primitives from framed bytes.