Readonly
contextContext used by the chunker. It usually represents chunker configuration like max, min chunk size etc. Usually chunker implementation library will provide utility function to initalize a context.
Optional
Readonly
nameChunker takes a context:T
object, buffer
containing bytes to be
chunked. Chunker is expected to return array of chunk byte lengths (from
the start of the buffer). If returned array is empty that signifies that
buffer contains no valid chunks.
Note: Consumer of the chunker is responsible for dealing with remaining
bytes in the buffer, that is unless end
is true signalling chunker that
end of the stream is reached.
Optional
end: booleanGenerated using TypeDoc
Stateful chunker is just like regular
Chunker
execpt it also carries mutablestate
that it is free to update as needed. It is adviced to use reguralChunker
and only resort to this when chunking logic may depend on previously seen bytes.