Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/gauntlet/imports/mod.ts>Buffer.concat

Work-in-progress front-end tool which does put a smile on my face
Latest
method Buffer.concat
import { Buffer } from "https://deno.land/x/gauntlet@v0.0.9/imports/mod.ts";

Returns a buffer which is the result of concatenating all the buffers in the list together.

If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. If the list has exactly one item, then the first item of the list is returned. If the list has more than one item, then a new Buffer is created.

Parameters

list: Uint8Array[]

An array of Buffer objects to concatenate

optional
totalLength: number

Total length of the buffers when concatenated. If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.