RecordWriter class
Streaming binary writer for @HybridRecord types (web edge).
Same wire format as the native RecordWriter (all field writers live in
RecordWriterBase); instead of a pointer edge, the web bridge copies
RecordWriterBase.takeFramedBytes into the WASM module heap in one bulk
write.
- Inheritance
-
- Object
- RecordWriterBase
- RecordWriter
Constructors
- RecordWriter([int initialCapacity = _initialCapacity])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- payloadLength → int
-
Number of payload bytes written so far.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
payloadView(
) → Uint8List -
A view of the payload written so far. Valid only until the next write —
a capacity grow replaces the backing buffer.
inherited
-
takeFramedBytes(
) → Uint8List -
Copies the accumulated payload into a fresh framed byte list:
[4-byte payload length][payload bytes].inherited -
toString(
) → String -
A string representation of this object.
inherited
-
writeBlob(
Uint8List blob) → void -
inherited
-
writeBool(
bool v) → void -
inherited
-
writeDouble(
double v) → void -
inherited
-
writeFloat64(
double v) → void -
inherited
-
writeInt(
int v) → void -
inherited
-
writeInt32(
int v) → void -
inherited
-
writeInt64(
int v) → void -
inherited
-
writeInt8(
int v) → void -
inherited
-
writeNullTag(
bool isNull) → void -
Writes a 1-byte null tag. 0 = null, 1 = value follows.
inherited
-
writeString(
String s) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
encodeIndexedListBytes<
T> (List< T> items, void writeItem(RecordWriter w, T item)) → Uint8List -
Encodes a list with an O(1) offset index table:
[4B count][8B×n offset table][item bytes]. -
encodeListBytes<
T> (List< T> items, void writeItem(RecordWriter w, T item)) → Uint8List -
Encodes a list of @HybridRecord objects into framed bytes
(
[4B len][payload]) ready to copy into the module heap. -
encodeNullableListBytes<
T> (List< T?> items, void writeItem(RecordWriter w, T item)) → Uint8List -
Encodes a list of nullable items:
[4B count][for each: 1B hasValue][item bytes (only if hasValue)]. -
encodePrimitiveListBytes<
T> (List< T> items, void writeItem(RecordWriter w, T item)) → Uint8List - Encodes a list of primitive values (int / double / bool / String).