Utilities to manipulate Uint8Arrays that are not built-in to JavaScript
Classes
An abstraction of multiple Uint8Arrays
- add(): voidvalue: Uint8Array,start?: number,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
poslocates by binary-search returns -1 if out of range - iterator(start?: number): IterableIterator<number>
Iterator of bytes from given position
- shift(n: number): void
Drop head
nbytes. - size()
Total size of bytes
- slice(): Uint8Arraystart: number,end?: number
Returns subset of bytes copied
Functions
Concatenate the given arrays into a new Uint8Array.
Copy bytes from the src array to the dst array. Returns the number of
bytes copied.
Returns true if the suffix array appears at the end of the source array, false otherwise.
Check whether binary arrays are equal to each other.
Returns true if the source array contains the needle array, false otherwise.
Returns the index of the first occurrence of the needle array in the source array, or -1 if it is not present.
Returns the index of the last occurrence of the needle array in the source array, or -1 if it is not present.
Returns a new Uint8Array composed of count repetitions of the source
array.
Returns true if the prefix array appears at the start of the source array, false otherwise.