Javascript DataView setBigInt64()

Introduction

The Javascript DataView setBigInt64() method stores a signed 64-bit integer value at the specified byte offset into the DataView.

dataview.setBigInt64(byteOffset, value [, littleEndian])
  • byteOffset - the offset, in bytes, from the start of the view to store the data.
  • value - the value to set as a BigInt.
  • littleEndian - Optional, boolean value. If false or undefined, a big-endian value is written. Otherwise, store as little-endian.

Using the setBigInt64 method

var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.setBigInt64(0, 3n);//  w ww .  j  a  va2  s  . c om
let a = dataview.getBigInt64(0);
console.log(a);



PreviousNext

Related