@adviser/cement - v0.0.0
    Preparing search index...

    Function stream2uint8array

    • Converts a ReadableStream of Uint8Array chunks to a single Uint8Array.

      Reads and concatenates all chunks from the stream into a single buffer. Useful for loading binary data from streams.

      Parameters

      • Optionalstream: ReadableStream<Uint8Array<ArrayBufferLike>> | null

        The ReadableStream to convert (returns empty Uint8Array if null/undefined)

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to the concatenated Uint8Array

      const response = await fetch('/image.png');
      const bytes = await stream2uint8array(response.body);