ChunkListBuffer
Defined in: packages/format-core/src/chunk-list-buffer.ts:152
Zero-copy-on-append DecodeBuffer over a chunk list, exposed to decoders as a ByteCursor.
Trades a cheaper append (no copy, unlike ByteAccumulator’s arena)
for a costlier per-byte read (a method call and a linear chunk-list search
instead of a native Uint8Array index). ByteAccumulator is the better
default: a decode buffer holds control data — commands, headers, length
prefixes — while declared payloads stream past it, so the copy it pays is
bounded by the decoder’s own limits. Reach for this one only when a protocol
accumulates a large value outside a declared body.
Implements
Section titled “Implements”DecodeBuffer<ByteCursor,Uint8Array>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ChunkListBuffer():
ChunkListBuffer
Returns
Section titled “Returns”ChunkListBuffer
Accessors
Section titled “Accessors”buffered
Section titled “buffered”Get Signature
Section titled “Get Signature”get buffered():
number
Defined in: packages/format-core/src/chunk-list-buffer.ts:157
Unconsumed unit count currently held.
Returns
Section titled “Returns”number
Unconsumed unit count currently held.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”append()
Section titled “append()”append(
chunk):void
Defined in: packages/format-core/src/chunk-list-buffer.ts:161
Append chunk, growing or compacting the backing as needed.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”clear()
Section titled “clear()”clear():
void
Defined in: packages/format-core/src/chunk-list-buffer.ts:202
Discard everything held.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”consume()
Section titled “consume()”consume(
count):void
Defined in: packages/format-core/src/chunk-list-buffer.ts:177
Drop count units from the front.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”take()
Section titled “take()”take():
Uint8Array
Defined in: packages/format-core/src/chunk-list-buffer.ts:195
Remove and return the unconsumed units, resetting the buffer.
Returns
Section titled “Returns”Uint8Array
Implementation of
Section titled “Implementation of”view()
Section titled “view()”view():
ByteCursor
Defined in: packages/format-core/src/chunk-list-buffer.ts:169
Window over the unconsumed units. Invalidated by the next append or consume; copy before retaining.