Method

JavaScriptCoreValuenew_typed_array_with_buffer

Declaration [src]

JSCValue*
jsc_value_new_typed_array_with_buffer (
  JSCValue* array_buffer,
  JSCTypedArrayType type,
  gsize offset,
  gssize length
)

Description [src]

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

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

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 array_buffer is exposed through the typed array. Omitting the length with a non-zero offset will expose the remainder of the array_buffer starting at the indicated offset.

Available since:2.38

Parameters

type JSCTypedArrayType
 

Type of array elements.

offset gsize
 

Offset, in bytes.

length gssize
 

Number of array elements, or -1.

Return value

Returns: JSCValue
 

A JSCValue.

 The caller of the method takes ownership of the data, and is responsible for freeing it.