The Javascript DataView byteLength property represents the length in bytes of this view.
dataview.byteLength
Using the byteLength
property
var buffer = new ArrayBuffer(8); var dataview = new DataView(buffer); console.log(dataview.byteLength); /*w ww .j a v a 2 s .c o m*/ var dataview2 = new DataView(buffer, 1, 5); console.log(dataview2.byteLength);