Dev HelpersOpen library
← Back

Read binary bytes

Read binary bytes. A self-contained example using the JavaScript runtime.

Open this example in the interactive library

Source code

const buffer = new ArrayBuffer(4),
  view = new DataView(buffer);
view.setUint32(0, 65535, false);
console.log([...new Uint8Array(buffer)]);

Sample output

[ 0, 0, 255, 255 ]