The DataView Object: What it is and How to Use it
Learn about the DataView object and its usage The DataView object is a view into an ArrayBuffer, similar to Typed Arrays. However, the items in the array can have different sizes and types. Let’s explore how to use it with an example: const buffer = new ArrayBuffer(64) const view = new DataView(buffer) When creating a DataView, we can specify the starting byte and the length of the view: const view = new DataView(buffer, 10) //start at byte 10 const view = new DataView(buffer, 10, 30) //start at byte 10, and add 30 items If no additional arguments are provided, the view starts at position 0 and includes all the bytes in the buffer....