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

x/esm/server/embed/types/node.ns.d.ts>Buffer.concat

A fast, global content delivery network for ES Modules.
Go to Latest
method Buffer.concat
import { Buffer } from "https://deno.land/x/esm@v97/server/embed/types/node.ns.d.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: ReadonlyArray<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.

Returns

Buffer