BlockWriter class final

Packs VXS documents into self-delimiting blocks.

A block has no document directory on purpose: documents are self-delimiting, and the segment index gives the absolute offset of every document. A directory would cost four bytes per document (3% of a 130-byte message).

Constructors

BlockWriter({int targetSize = 64 * 1024, bool checksum = true})
Creates a writer that targets targetSize bytes per block.

Properties

checksum → bool
Whether a CRC-32C trailer is written.
final
docCount → int
Number of documents appended.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Whether nothing has been appended.
no setter
isFull → bool
Whether the target size has been reached; callers typically flush now.
no setter
length → int
Bytes that will be produced, including header and trailer.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

append(Bytes doc) → int
Appends one encoded document and returns its offset inside the payload.
finish() → Bytes
Writes the header and optional checksum, returning the finished block.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Discards the contents; the previous block view stays valid.
toString() → String
A string representation of this object.
inherited

Operators

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