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

    Function rebufferArray

    • Rebuffers an array of Uint8Arrays to a specific chunk size.

      Convenience wrapper around rebuffer stream for array inputs/outputs.

      Parameters

      • a: Uint8Array<ArrayBufferLike>[]

        Array of Uint8Arrays to rebuffer

      • chunkSize: number

        Target size for output chunks

      Returns Promise<Uint8Array<ArrayBufferLike>[]>

      Promise resolving to array of rebuffered chunks

      const chunks = [
      new Uint8Array([1, 2]),
      new Uint8Array([3, 4, 5]),
      new Uint8Array([6])
      ];
      const rebuffered = await rebufferArray(chunks, 3);
      // [Uint8Array([1,2,3]), Uint8Array([4,5,6])]