ArrayBuffer

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

MDN Reference

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open external override val byteLength: Int

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

Link copied to clipboard
external val detached: Boolean

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

Link copied to clipboard
open external 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
external val resizable: Boolean

Returns true if this ArrayBuffer can be resized.

Functions

Link copied to clipboard
external fun resize(newByteLength: Int)

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

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

Returns a section of an ArrayBuffer.

Link copied to clipboard
Link copied to clipboard
external 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
external fun transferToFixedLength(newByteLength: Int): ArrayBuffer

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