Value.typed_array_with_buffer


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "2.38" ) ]
public Value.typed_array_with_buffer (Value array_buffer, TypedArrayType type, size_t offset, ssize_t length)

Create a new typed array value with elements from an array buffer.

Create a Value referencing a new typed array value containing elements of the given type, where the elements are stored at the memory region represented by the this.

The type must *not* be jsc_typed_array_none.

The offset and length parameters can be used to indicate which part of the array buffer can be accessed through the typed array. If both are omitted (passing zero as offset, and `-1` as length), the whole this is exposed through the typed array. Omitting the length with a non-zero offset will expose the remainder of the this starting at the indicated offset.

Parameters:

this

a Value.

type

type of array elements.

offset

offset, in bytes.

length

number of array elements, or `-1`.

Returns:

a Value