Introduced in Gecko 2
(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
DRAFT
This page is not complete.
The ArrayBufferView type describes a particular view on the contents of an ArrayBuffer's data.
Of note is that you may create multiple views into the same buffer, each looking at the buffer's contents starting at a particular offset. This makes it possible to set up views of different data types to read the contents of a buffer based on the types of data at specific offsets into the buffer.
Note: Typically, you'll instantiate one of the subclasses of this object instead of this base class. Those provide access to the data formatted using specific data types.
Attributes
| Attribute | Type | Description |
buffer | ArrayBuffer | The buffer this view references. Read only. |
byteLength | unsigned long | The length, in bytes, of the view. Read only. |
byteOffset | unsigned long | The offset, in bytes, to the first byte of the view within the ArrayBuffer. |
Typed array subclasses
The following subclasses provide buffer views allowing access to the data in specific data types:
| Type | Size | Description | Equivalent C type |
Int8Array | 1 | 8-bit twos complement signed integer | signed char |
Uint8Array | 1 | 8-bit unsigned integer | unsigned char |
Int16Array | 2 | 16-bit twos complement signed integer | short |
Uint16Array | 2 | 16-bit unsigned integer | unsigned short |
Int32Array | 4 | 32-bit twos complement signed integer | int |
Uint32Array | 4 | 32-bit unsigned integer | unsigned int |
Float32Array | 4 | 32-bit IEEE floating point number | float |
Float64Array | 8 | 64-bit IEEE floating point number | double |
Mozilla Developer Network