Documentation

Std.Http.Internal.ChunkedBuffer

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.

A structure that accumulates multiple ByteArrays efficiently by tracking them in an array and maintaining the total size. This allows building large buffers without repeated allocations and copies.

  • The accumulated byte arrays.

  • size : Nat

    The total size in bytes of all accumulated arrays

Instances For
    @[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
      Instances For
        @[inline]

        Checks whether the buffer is empty.

        Equations
        Instances For