GuestBytes

A light wrapper around a guest buffer-like value, providing indexed access. This helper can be used to wrap the ArrayBuffer instances backing a Uint8Array or similar, for convenience when manipulating them.

Note that no validation of any kind is performed during construction or by any of the operators.

Constructors

Link copied to clipboard
constructor(value: PolyglotValue)

Properties

Link copied to clipboard

Returns the length in bytes of the wrapped value as a Long, useful for certain operations.

Link copied to clipboard
val size: Int

Returns the length in bytes of the wrapped value.

Functions

Link copied to clipboard
operator fun get(index: Int): Byte
operator fun get(index: Long): Byte

Returns the value of the wrapped buffer at the given index.

Link copied to clipboard
operator fun set(index: Int, value: Byte)
operator fun set(index: Long, value: Byte)

Sets the value of the wrapped buffer at the given index.