Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/bytes/bytes_list.ts>BytesList

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class BytesList
import { BytesList } from "https://deno.land/std@0.177.0/bytes/bytes_list.ts";

An abstraction of multiple Uint8Arrays

Constructors

new
BytesList()

Methods

add(
value: Uint8Array,
start?,
end?,
)

Push bytes with given offset infos

concat(): Uint8Array

Concatenate chunks into single Uint8Array copied.

get(i: number): number

Get indexed byte from chunks

getChunkIndex(pos: number): number

Find chunk index in which pos locates by binary-search returns -1 if out of range

iterator(start?): IterableIterator<number>

Iterator of bytes from given position

shift(n: number)

Drop head n bytes.

Total size of bytes

slice(start: number, end?: number): Uint8Array

Returns subset of bytes copied