JsBinaryData Class
Access to the bytes of the buffer sources (ArrayBuffer, SharedArrayBuffer, DataView and the typed arrays), without running JavaScript code.
public static class JsBinaryDataMethods
| Name | Description |
|---|---|
| DetachArrayBuffer(JsValue, JsValue) | Detaches an ArrayBuffer (DetachArrayBuffer(buffer, key)); the key is its [[ArrayBufferDetachKey]]. |
| GetSharedDataBlock(JsValue) | Gets the Shared Data Block of a SharedArrayBuffer, which JsRealm.CreateSharedArrayBuffer can share with a buffer of another engine (on another thread); null for the other values. |
| IsResizable(JsValue) | Gets whether a buffer source is backed by a resizable ArrayBuffer or a growable SharedArrayBuffer: the buffer itself, or the buffer that a typed array or a DataView views (IsFixedLengthArrayBuffer is false). Returns false for the other values. |
| TryGetBufferSource(JsValue, JsBufferKind, bool, Memory<byte>) | Gets the kind and the bytes of a buffer source. bytes is a view of the data block of the buffer (the writes are visible to JavaScript); it is empty when the buffer is detached or the view is out of bounds. Returns false for the other values. |
DetachArrayBuffer(JsValue, JsValue)
JsBinaryData.csDetaches an ArrayBuffer (DetachArrayBuffer(buffer, key)); the key is its [[ArrayBufferDetachKey]].
Parameters
Exceptions
ArgumentException- The value is not an ArrayBuffer.
JsException- The key is not the detach key of the buffer (a TypeError).
IsResizable(JsValue)
JsBinaryData.csGets whether a buffer source is backed by a resizable ArrayBuffer or a growable SharedArrayBuffer: the buffer itself, or the buffer that a typed array or a DataView views (IsFixedLengthArrayBuffer is false). Returns false for the other values.
TryGetBufferSource(JsValue, JsBufferKind, bool, Memory<byte>)
JsBinaryData.csGets the kind and the bytes of a buffer source. bytes is a view of the data block of the buffer (the writes are visible to JavaScript); it is empty when the buffer is detached or the view is out of bounds. Returns false for the other values.