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

    Function fnStream2uint8arrayGrowResizable

    • Creates a resizable-buffer strategy with a custom maximum byte length.

      The strategy grows a resizable ArrayBuffer in place while reading. On runtimes that resize without copying, peak memory stays close to the final stream size instead of the input + output doubling of stream2uint8arrayChunkAndJoin. The returned Uint8Array is a length-tracking view whose buffer may still be flagged as resizable.

      Throws a RangeError when the stream exceeds maxBuf.

      Parameters

      • maxBuf: number = STREAM2UINT8ARRAY_RESIZABLE_MAX_BYTES

        Maximum number of bytes the strategy accepts

      Returns Stream2Uint8ArrayStrategy

      A strategy suitable for the second argument of stream2uint8array

      const bytes = await stream2uint8array(response.body, fnStream2uint8arrayGrowResizable(8 * 1024 * 1024));