RecordWriterBase class
Platform-neutral core of the @HybridRecord binary writer.
Wire format (all integers little-endian): int → 8 bytes (int64) double → 8 bytes (float64) bool → 1 byte (0 = false, 1 = true) String → 4-byte UTF-8 byte count, then UTF-8 bytes null tag → 1 byte (0 = null, 1 = present); written before any nullable list → 4-byte element count, then elements back-to-back
The framed form prefixes the payload with a 4-byte int32 total length so
the receiver knows how many bytes to consume. The native RecordWriter
adds toNative(Allocator); the web bridge copies takeFramedBytes into
the module heap.
- Implementers
Constructors
- RecordWriterBase([int initialCapacity = _initialCapacity])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- payloadLength → int
-
Number of payload bytes written so far.
no setter
- 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.
-
takeFramedBytes(
) → Uint8List -
Copies the accumulated payload into a fresh framed byte list:
[4-byte payload length][payload bytes]. -
toString(
) → String -
A string representation of this object.
inherited
-
writeBlob(
Uint8List blob) → void -
writeBool(
bool v) → void -
writeDouble(
double v) → void -
writeFloat64(
double v) → void -
writeInt(
int v) → void -
writeInt32(
int v) → void -
writeInt64(
int v) → void -
writeInt8(
int v) → void -
writeNullTag(
bool isNull) → void - Writes a 1-byte null tag. 0 = null, 1 = value follows.
-
writeString(
String s) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
writeIndexedListPayload<
T, W extends RecordWriterBase> (W w, List< T> items, void writeItem(W w, T item)) → void -
[4B count][8B×n offset table][item bytes]— offsets from payload start. This layout allows O(1) random item access (see the native LazyRecordList). -
writeListPayload<
T, W extends RecordWriterBase> (W w, List< T> items, void writeItem(W w, T item)) → void -
[4B count][items...] -
writeNullableListPayload<
T, W extends RecordWriterBase> (W w, List< T?> items, void writeItem(W w, T item)) → void -
[4B count][for each: 1B hasValue][item bytes (only if hasValue)]