The Javascript DataView setUint32() method stores an unsigned 32-bit integer value at the specified offset to DataView.
dataview.setUint32(byteOffset, value [, littleEndian])
byteOffset
- the offset, in byte, from the start of the view.value
- the value to set.littleEndian
- Optional, boolean value. If false or undefined, a big-endian value is written. Otherwise use the little endian.Using the setUint32 method
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); dataview.setUint32(1, 3);/* www. ja v a 2s . co m*/ let a = dataview.getUint32(1); console.log(a);