The DataView constructor.
new DataView(buffer, byteOffset?, byteLength?)
buffer
The ArrayBuffer to view.
byteOffset optional
The offset in bytes from the start of the buffer. If not specified, the view of the buffer starts at the beginning of the buffer.
byteLength optional
The number of bytes to view. If not specified, the view extends to the end of the buffer.
A new DataView object.
var buffer = new ArrayBuffer(4)
var view = new DataView(buffer)
view.setUint16(2, 0xffff)
buffer
ArrayBuffer [0, 0, 255, 255]