MultiResultStreamDecoder class
Incremental decoder for the streaming multi-result wire format used by
odbc_stream_multi_start_batched / _async (M8 in v3.3.0).
Each chunk emitted by the native engine is a (possibly partial) sequence of frames:
[tag: u8] [len: u32 LE] [payload: len bytes]
Callers feed raw chunks through feed; each call returns the items
completed by the new bytes. Items are surfaced as soon as their full
payload has arrived. Bytes belonging to a partially-received frame are
kept inside the decoder until the next feed/flush call.
Example:
final decoder = MultiResultStreamDecoder();
while (stream has more) {
final chunk = native.streamFetch(...);
for (final item in decoder.feed(chunk)) {
// emit item to consumer
}
}
// Trailing bytes after EOS are an error.
decoder.assertExhausted();
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemsDecoded → int
-
no setter
- pendingBytes → int
-
Number of bytes currently held back inside the decoder waiting for the
rest of a frame to arrive. Useful for backpressure / observability.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
assertExhausted(
) → void - Verifies that no partial frame remains buffered. Call after the engine signalled end-of-stream. Throws FormatException when there are trailing bytes (always indicates a wire-format bug).
-
feed(
Uint8List chunk) → List< MultiResultItem> -
Append
chunkto the internal buffer and return any items that became fully available. The returned list may be empty if the chunk only completed part of a frame. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited