Documentation

Std.Internal.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.

    Equations
    Instances For
      @[inline]

      Writes a ByteArray to the ChunkedBuffer.

      Equations
      Instances For
        @[inline]

        Writes a ChunkedBuffer to the ChunkedBuffer.

        Equations
        Instances For
          @[inline]

          Writes a Char to the ChunkedBuffer. Only the low byte is written (Char.toUInt8), so this is only correct for ASCII characters.

          Equations
          Instances For
            @[inline]

            Writes a String to the ChunkedBuffer.

            Equations
            Instances For
              @[inline]

              Turn the combined structure into a single contiguous ByteArray.

              Equations
              Instances For
                @[inline]

                Build from a ByteArray directly.

                Equations
                Instances For
                  @[inline]

                  Build from an array of ByteArrays directly.

                  Equations
                  Instances For
                    @[inline]

                    Checks whether the buffer is empty.

                    Equations
                    Instances For