arrayBufferBytes method

Bytes arrayBufferBytes({
  1. JSValuePointer? exception,
})

Returns a pointer to the data buffer that serves as the backing store for a JavaScript Typed Array object. The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls. exception (JSValueRef*) A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.

Implementation

Bytes arrayBufferBytes({
  JSValuePointer? exception,
}) {
  return Bytes(
      JSTypedArray.jSObjectGetArrayBufferBytesPtr(context.pointer, pointer,
          (exception ?? JSValuePointer(nullptr)).pointer),
      JSTypedArray.jSObjectGetArrayBufferByteLength(context.pointer, pointer,
          (exception ?? JSValuePointer(nullptr)).pointer));
}