Tuesday, 26 March, 2019 UTC


Summary

Javascript ArrayBuffer Example | ArrayBuffer Object Tutorial is today’s topic. The ArrayBuffer object is used to represent the generic, fixed-length raw binary data buffer. You cannot directly manipulate the contents of the ArrayBuffer. ArrayBuffer is used to keep binary data. It can be the binary data of an image for example. ArrayBuffer can be used to get data of jpg image (RGB bytes) and produce a png out of it by adding alpha byte.
Javascript ArrayBuffer Example
The syntax of ArrayBuffer is following.
new ArrayBuffer(length)
The length parameter is the length of the ArrayBuffer which is in the bytes. The length size is in bytes.
See the following example.
// app.js

let app = new ArrayBuffer(6)
console.log(app)
The output is following.
 
We create an 8-byte buffer with an Int32Array view referring to the buffer. See the following example.
 
Finally, ArrayBuffer Object Tutorial is over.
The post Javascript ArrayBuffer Example | ArrayBuffer Object Tutorial appeared first on AppDividend.