Skip to main content
Module

std/bytes/bytes_list.ts>BytesList

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

An abstraction of multiple Uint8Arrays

Constructors

new
BytesList()

Properties

private
chunks: { value: Uint8Array; start: number; end: number; offset: number; }[]
private
len: number

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