What is DataView ?
A data view is a view on a data table.
DataView provides a low-level interface for reading and writing multiple number types in a binary ArrayBuffer, without caring about the platform’s end.
DataView enables you to create different views of the data stored in a DataTable,
DataView is used in data-binding applications.
DataView is used to expose the data in a table with different sort orders.
DataView also allows us to filter the data by row state or based on a filter expression.
new DataView(buffer, byteOffset, byteLength,)
An ArrayBuffer that is already existing to store the new DataView object.
offset(in bytes) in the buffer is used to start a new view of the buffer. By default, the new view starts from the first byte.
It represents the number of elements in the byte array. By default, the buffer’s length is considered as the length of the view.
It returns a new DataView object which will represent the specified data buffer.
The value of a.getInt8(0) = 1
The value of b.getInt8(0) = 1
The value of c.getInt8(0) = 2
|Sno||Method / Function||Description|
|1||DataView.getFloat32()||DataView.getFloat32() method is used to get 32-bit float number at a specified location.|
|2||DataView.getFloat64()||DataView.getFloat64() method is used to get 64-bit float(double) number at a specified location.|
|3||DataView.getInt16()||DataView.getInt16() method is used to gets a signed 16-bit integer(short) number at a specified location.|
|4||Dataview.getInt32()||DataView.getInt32() method is used to gets a signed 32-bit integer(long) number at a specified location.|
|5||DataView.getInt8()||DataView.getInt8() method is used to gets a signed 8-bit integer(byte) number at a specified location.|
|6||DataView.getUint16()||DataView.getUint16() method is used to gets a unsigned 16-bit integer(unsigned short) number at a specified location.|
|7||DataView.getUint32()||DataView.getUint32() method is used to gets a unsigned 32-bit integer(unsigned long) number at a specified location.|
|8||DataView.getUint8()||DataView.getUint8() method is used to gets a unsigned 8-bit integer(unsigned byte) number at a specified location.|