Uint8Array
An unsigned byte view of an ArrayBuffer. Stores truncate and wrap modulo 256.
Binary dataType:
typescriptnative.Uint8Arrayimport { Uint8Array } from "typescriptnative"Type mapping
| TypeScript | JVM | Notes |
|---|---|---|
Uint8Array | typescriptnative.Uint8Array | One class, imported from the runtime package in TypeScript. |
Uint8Array class
declare class Uint8ArrayUnsigned 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(): ArrayBuffergetByteOffset(): intgetByteLength(): intgetLength(): intget(index: int): intset(index: int, value: double): voidassign(index: int, value: double): doubleJavaScript assignment evaluates to its original value even when the stored byte wraps.
update(index: int, delta: int, postfix: boolean): intsubarray(): Uint8Arraysubarray(start: int): Uint8Arraysubarray(start: int, end: int): Uint8ArrayasByteBuffer(): ByteBufferGenerated when the website builds, from Uint8Array.java.