public interface DataView extends ArrayBufferView
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
.
Modifier and Type | Method and Description |
---|---|
float |
getFloat32(int byteOffset) |
float |
getFloat32(int byteOffset,
boolean littleEndian) |
double |
getFloat64(int byteOffset) |
double |
getFloat64(int byteOffset,
boolean littleEndian) |
short |
getInt16(int byteOffset) |
short |
getInt16(int byteOffset,
boolean littleEndian) |
int |
getInt32(int byteOffset) |
int |
getInt32(int byteOffset,
boolean littleEndian) |
Object |
getInt8()
Gets a signed 8-bit integer at the specified byte offset from the start of the view.
|
int |
getUint16(int byteOffset) |
int |
getUint16(int byteOffset,
boolean littleEndian) |
int |
getUint32(int byteOffset) |
int |
getUint32(int byteOffset,
boolean littleEndian) |
Object |
getUint8()
Gets an unsigned 8-bit integer at the specified byte offset from the start of the view.
|
void |
setFloat32(int byteOffset,
float value) |
void |
setFloat32(int byteOffset,
float value,
boolean littleEndian) |
void |
setFloat64(int byteOffset,
double value) |
void |
setFloat64(int byteOffset,
double value,
boolean littleEndian) |
void |
setInt16(int byteOffset,
short value) |
void |
setInt16(int byteOffset,
short value,
boolean littleEndian) |
void |
setInt32(int byteOffset,
int value) |
void |
setInt32(int byteOffset,
int value,
boolean littleEndian) |
void |
setInt8() |
void |
setUint16(int byteOffset,
int value) |
void |
setUint16(int byteOffset,
int value,
boolean littleEndian) |
void |
setUint32(int byteOffset,
int value) |
void |
setUint32(int byteOffset,
int value,
boolean littleEndian) |
void |
setUint8() |
getBuffer, getByteLength, getByteOffset
float getFloat32(int byteOffset)
float getFloat32(int byteOffset, boolean littleEndian)
double getFloat64(int byteOffset)
double getFloat64(int byteOffset, boolean littleEndian)
short getInt16(int byteOffset)
short getInt16(int byteOffset, boolean littleEndian)
int getInt32(int byteOffset)
int getInt32(int byteOffset, boolean littleEndian)
Object getInt8()
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 viewint getUint16(int byteOffset)
int getUint16(int byteOffset, boolean littleEndian)
int getUint32(int byteOffset)
int getUint32(int byteOffset, boolean littleEndian)
Object getUint8()
Gets 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 viewvoid setFloat32(int byteOffset, float value)
void setFloat32(int byteOffset, float value, boolean littleEndian)
void setFloat64(int byteOffset, double value)
void setFloat64(int byteOffset, double value, boolean littleEndian)
void setInt16(int byteOffset, short value)
void setInt16(int byteOffset, short value, boolean littleEndian)
void setInt32(int byteOffset, int value)
void setInt32(int byteOffset, int value, boolean littleEndian)
void setInt8()
void setUint16(int byteOffset, int value)
void setUint16(int byteOffset, int value, boolean littleEndian)
void setUint32(int byteOffset, int value)
void setUint32(int byteOffset, int value, boolean littleEndian)
void setUint8()
Copyright © 2016. All rights reserved.