DataView
is not yet implemented in Gecko. It is implemented in Chrome 9.An ArrayBuffer
is a useful object for representing an arbitrary chunk of data. In many cases, such data will be read from disk or from the network, and will not follow the alignment restrictions that are imposed on the Typed Array Views described earlier. In addition, the data will often be heterogeneous in nature and have a defined byte order.
The DataView
view provides a low-level interface for reading such data from and writing it to an ArrayBuffer
.
Returns a new DataView
object using the passed ArrayBuffer for its storage.
DataView DataView( ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long byteLength );
buffer
ArrayBuffer
to use as the storage for the new DataView
object.byteOffset
Optional
byteLength
Optional
A new DataView
object representing the specified data buffer.
INDEX_SIZE_ERR
byteOffset
and byteLength
result in the specified view extending past the end of the buffer.Gets a signed 8-bit integer at the specified byte offset from the start of the view.
offset
INDEX_SIZE_ERR
byteOffset
is set such as it would read beyond the end of the viewGets an unsigned 8-bit integer at the specified byte offset from the start of the view.
offset
INDEX_SIZE_ERR
byteOffset
is set such as it would read beyond the end of the view