Skip to Content
API reference

ArrayBuffer

Fixed-length byte storage shared by typed views and NIO buffers.

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

Type mapping

TypeScriptJVMNotes
ArrayBuffertypescriptnative.ArrayBufferOne class, imported from the runtime package in TypeScript.

ArrayBuffer class

declare class ArrayBuffer

Fixed-length storage shared by typed views and NIO. Buffer positions never escape to another owner.

Constructors

new ArrayBuffer(byteLength: int)

Static methods

static allocateDirect(byteLength: int): ArrayBuffer

Allocate off-heap storage. The buffer remains alive while any view references it.

static wrap(source: ByteBuffer): ArrayBuffer

Share the caller's remaining range. Subsequent changes to its position or limit do not move the view.

Methods

getByteLength(): int
isDirect(): boolean
asByteBuffer(): ByteBuffer
slice(): ArrayBuffer
slice(start: int): ArrayBuffer
slice(start: int, end: int): ArrayBuffer

Generated when the website builds, from ArrayBuffer.java.

Language

Remembered on every API page

On this page