std/bytes/bytes_list.ts

Deno standard library
Go to Latest
class BytesList
import { BytesList } from "https://deno.land/std@0.147.0/bytes/bytes_list.ts?s=BytesList";

An abstraction of multiple Uint8Arrays

Constructors

new
BytesList()
[src]

Methods

add(
value: Uint8Array,
start?,
end?,
)
[src]

Push bytes with given offset infos

concat(): Uint8Array[src]

Concatenate chunks into single Uint8Array copied.

get(i: number): number[src]

Get indexed byte from chunks

getChunkIndex(pos: number): number[src]

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

iterator(start?): IterableIterator<number>[src]

Iterator of bytes from given position

shift(n: number)[src]

Drop head n bytes.

size()[src]

Total size of bytes

slice(start: number, end?: number): Uint8Array[src]

Returns subset of bytes copied