ApplesauceOS
Read Markdown ↗Download .md

CPointer.readBytes

Copy a bounded managed-buffer range into JS.

js
pointer.readBytes(length = byteLength, offset = 0)

Arguments

ArgumentTypeMeaning
lengthnumberBytes to read; default byteLength. Maximum 65536 per operation.
offsetnumberStarting byte offset; default 0.

Returns

Array of byte values.

Example

js
const buffer = C.alloc(4);
console.log(buffer.readBytes(4));
buffer.release();

Notes

External pointer memory cannot be read with this API.

All JavaScript APIs · Automation playbook