Javascript DataView setInt8()

Introduction

The Javascript DataView setInt8() method stores a signed 8-bit integer value at the specified offset to the DataView.

dataview.setInt8(byteOffset, value)
  • byteOffset - the offset, in byte, from the start of the view.
  • value - the value to set.

Using the setInt8 method

var buffer = new ArrayBuffer(8);
var dataview = new DataView(buffer);
dataview.setInt8(1, 3);//from ww w  .j  ava  2  s . com
let a = dataview.getInt8(1);
console.log(a);// 3



PreviousNext

Related