Module

std/bytes/bytes_list.ts>BytesList

Deno standard library
Go to Latest
class BytesList
import { BytesList } from "https://dotland.deno.dev/std@0.181.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