ProtocolByteAccumulator class

Single reusable buffer for incremental protocol framing.

Incoming stream chunks are appended once. take transfers ownership of the frame bytes (zero-copy view of the prior backing store) so callers that retain the frame (including lazy UTF-8 string cells) keep a live buffer. The accumulator allocates a fresh backing store for subsequent adds.

Constructors

ProtocolByteAccumulator({int initialCapacity = 64 * 1024})

Properties

hashCode int
The hash code for this object.
no setterinherited
length int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Uint8List chunk) → void
drop(int count) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek(int count) Uint8List
take(int count) Uint8List
Returns a view of the leading count bytes and releases them from this accumulator. The returned list keeps the previous backing store alive.
toString() String
A string representation of this object.
inherited

Operators

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