ArrayBuffer

external class ArrayBuffer(val byteLength: Int, options: ArrayBufferOptions? = definedExternally) : ArrayBufferLike, BufferSource, Transferable(source)

Constructors

Link copied to clipboard
constructor(byteLength: Int, options: ArrayBufferOptions? = definedExternally)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val byteLength: Int

Read-only. The length of the ArrayBuffer (in bytes).

Link copied to clipboard

Returns a boolean indicating whether or not this buffer has been detached (transferred).

Link copied to clipboard
open override val maxByteLength: Int

If this ArrayBuffer is resizable, returns the maximum byte length given during construction; returns the byte length if not.

Link copied to clipboard

Returns true if this ArrayBuffer can be resized.

Functions

Link copied to clipboard
fun resize(newByteLength: Int)

Resizes the ArrayBuffer to the specified size (in bytes).

Link copied to clipboard
open override fun slice(begin: Int, end: Int): ArrayBuffer

Returns a section of an ArrayBuffer.

Link copied to clipboard
fun transfer(newByteLength: Int): ArrayBuffer

Creates a new ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

Link copied to clipboard

Creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.