ChunkedBuffer #
This module provides an efficient way to concatenate multiple ByteArrays by deferring the actual
concatenation until necessary. This is particularly useful in HTTP response building and streaming
scenarios where data is accumulated incrementally.
@[inline]
Append a single ByteArray to the ChunkedBuffer. An empty ByteArray is not kept as a piece.
Equations
Instances For
@[inline]
Turn the combined structure into a single contiguous ByteArray.
Equations
- cb.toByteArray = if h : 1 = cb.data.size then cb.data[0] else Array.foldl (fun (x1 x2 : ByteArray) => x1 ++ x2) (ByteArray.emptyWithCapacity cb.size) cb.data
Instances For
@[inline]
Checks whether the buffer is empty.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- Std.Http.Internal.ChunkedBuffer.instEmptyCollection = { emptyCollection := Std.Http.Internal.ChunkedBuffer.empty }