public class DataViewNativeEmul extends java.lang.Object implements DataView
DataView for platforms with typed array
support but missing DataView (ie, Firefox).| Modifier and Type | Field and Description |
|---|---|
protected ArrayBuffer |
buffer |
protected int |
bufferByteOffset |
protected int |
byteLength |
protected Uint8ArrayNative |
tempBuffer
A temporary buffer used for reversing bytes.
|
protected Uint8ArrayNative |
uint8Array
A view of the underlying buffer as bytes.
|
| Modifier | Constructor and Description |
|---|---|
protected |
DataViewNativeEmul(ArrayBuffer buffer,
int byteOffset,
int byteLength) |
| Modifier and Type | Method and Description |
|---|---|
ArrayBuffer |
buffer()
Get the underlying
ArrayBuffer. |
int |
byteLength()
Get the length of this view in bytes.
|
int |
byteOffset()
Get the offset from the beginning of the underlying
ArrayBuffer. |
static DataView |
create(ArrayBuffer buffer,
int byteOffset,
int byteLength) |
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) |
byte |
getInt8(int byteOffset) |
int |
getUint16(int byteOffset) |
int |
getUint16(int byteOffset,
boolean littleEndian) |
long |
getUint32(int byteOffset) |
long |
getUint32(int byteOffset,
boolean littleEndian) |
double |
getUint32AsDouble(int byteOffset) |
double |
getUint32AsDouble(int byteOffset,
boolean littleEndian) |
short |
getUint8(int byteOffset) |
protected void |
reverseBytes(Uint8ArrayNative src,
int srcOfs,
int len,
Uint8ArrayNative dest,
int destOfs)
Copy bytes from the underlying buffer to a temporary buffer, reversing them
in the process.
|
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,
int value) |
void |
setInt16(int byteOffset,
int value,
boolean littleEndian) |
void |
setInt32(int byteOffset,
int value) |
void |
setInt32(int byteOffset,
int value,
boolean littleEndian) |
void |
setInt8(int byteOffset,
int value) |
void |
setUint16(int byteOffset,
int value) |
void |
setUint16(int byteOffset,
int value,
boolean littleEndian) |
void |
setUint32(int byteOffset,
long value) |
void |
setUint32(int byteOffset,
long value,
boolean littleEndian) |
void |
setUint32FromDouble(int byteOffset,
double value) |
void |
setUint32FromDouble(int byteOffset,
double value,
boolean littleEndian) |
void |
setUint8(int byteOffset,
int value) |
protected final ArrayBuffer buffer
protected final int bufferByteOffset
protected final int byteLength
protected final Uint8ArrayNative tempBuffer
protected final Uint8ArrayNative uint8Array
protected DataViewNativeEmul(ArrayBuffer buffer, int byteOffset, int byteLength)
public static DataView create(ArrayBuffer buffer, int byteOffset, int byteLength)
buffer - byteOffset - byteLength - DataView instancepublic ArrayBuffer buffer()
ArrayBufferViewArrayBuffer.buffer in interface ArrayBufferViewArrayBuffer instance backing this viewpublic int byteLength()
ArrayBufferViewbyteLength in interface ArrayBufferViewpublic int byteOffset()
ArrayBufferViewArrayBuffer.byteOffset in interface ArrayBufferViewArrayBufferView.buffer()public float getFloat32(int byteOffset)
getFloat32 in interface DataViewpublic float getFloat32(int byteOffset,
boolean littleEndian)
getFloat32 in interface DataViewpublic double getFloat64(int byteOffset)
getFloat64 in interface DataViewpublic double getFloat64(int byteOffset,
boolean littleEndian)
getFloat64 in interface DataViewpublic short getInt16(int byteOffset,
boolean littleEndian)
public int getInt32(int byteOffset,
boolean littleEndian)
public int getUint16(int byteOffset,
boolean littleEndian)
public long getUint32(int byteOffset,
boolean littleEndian)
public double getUint32AsDouble(int byteOffset)
getUint32AsDouble in interface DataViewpublic double getUint32AsDouble(int byteOffset,
boolean littleEndian)
getUint32AsDouble in interface DataViewpublic void setFloat32(int byteOffset,
float value)
setFloat32 in interface DataViewpublic void setFloat32(int byteOffset,
float value,
boolean littleEndian)
setFloat32 in interface DataViewpublic void setFloat64(int byteOffset,
double value)
setFloat64 in interface DataViewpublic void setFloat64(int byteOffset,
double value,
boolean littleEndian)
setFloat64 in interface DataViewpublic void setInt16(int byteOffset,
int value)
public void setInt16(int byteOffset,
int value,
boolean littleEndian)
public void setInt32(int byteOffset,
int value)
public void setInt32(int byteOffset,
int value,
boolean littleEndian)
public void setUint16(int byteOffset,
int value)
public void setUint16(int byteOffset,
int value,
boolean littleEndian)
public void setUint32(int byteOffset,
long value)
public void setUint32(int byteOffset,
long value,
boolean littleEndian)
public void setUint32FromDouble(int byteOffset,
double value)
setUint32FromDouble in interface DataViewpublic void setUint32FromDouble(int byteOffset,
double value,
boolean littleEndian)
setUint32FromDouble in interface DataViewpublic void setUint8(int byteOffset,
int value)
protected final void reverseBytes(Uint8ArrayNative src, int srcOfs, int len, Uint8ArrayNative dest, int destOfs)
src - srcOfs - offset into bufferlen - number of bytes to copydest - destOfs -