RecordWriter class

Streaming binary writer for @HybridRecord types (native dart:ffi edge).

The wire format and all field writers live in RecordWriterBase; this class adds the pointer edge: toNative and the encode* helpers that copy the payload into allocator-owned native memory.

Inheritance

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
toNative(Allocator alloc) Pointer<Uint8>
Copies the accumulated payload to an allocator-owned native buffer.
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

encodeIndexedList<T>(List<T> items, void writeItem(RecordWriter w, T item), Allocator alloc) Pointer<Uint8>
Encodes a list of @HybridRecord objects with an O(1) offset index table.
encodeIndexedPrimitiveList<T>(List<T> items, void writeItem(RecordWriter w, T item), Allocator alloc) Pointer<Uint8>
Encodes a list of primitive values with an O(1) offset index table.
encodeList<T>(List<T> items, void writeItem(RecordWriter w, T item), Allocator alloc) Pointer<Uint8>
Encodes a list of @HybridRecord objects into a single native buffer.
encodeNullableList<T>(List<T?> items, void writeItem(RecordWriter w, T item), Allocator alloc) Pointer<Uint8>
Encodes a list of nullable items.
encodePrimitiveList<T>(List<T> items, void writeItem(RecordWriter w, T item), Allocator alloc) Pointer<Uint8>
Encodes a list of primitive values (int / double / bool / String).