Skip to Content
API reference

Uint8Array

An unsigned byte view of an ArrayBuffer. Stores truncate and wrap modulo 256.

Binary dataType: typescriptnative.Uint8Array
import { Uint8Array } from "typescriptnative"

Type mapping

TypeScriptJVMNotes
Uint8Arraytypescriptnative.Uint8ArrayOne class, imported from the runtime package in TypeScript.

Uint8Array class

declare class Uint8Array

Unsigned bytes in shared writable storage. Values written through a view are reduced modulo 256.

Constructors

new Uint8Array(length: int)
new Uint8Array(buffer: ArrayBuffer)
new Uint8Array(buffer: ArrayBuffer, offset: int)
new Uint8Array(buffer: ArrayBuffer, offset: int, length: int)

Methods

getBuffer(): ArrayBuffer
getByteOffset(): int
getByteLength(): int
getLength(): int
get(index: int): int
set(index: int, value: double): void
assign(index: int, value: double): double

JavaScript assignment evaluates to its original value even when the stored byte wraps.

update(index: int, delta: int, postfix: boolean): int
subarray(): Uint8Array
subarray(start: int): Uint8Array
subarray(start: int, end: int): Uint8Array
asByteBuffer(): ByteBuffer

Generated when the website builds, from Uint8Array.java.

Language

Remembered on every API page

On this page