public class JSDataView extends JSObject
JSObject.jsexport, JSObject.Property<T>
JSPropertyAttributeDontDelete, JSPropertyAttributeDontEnum, JSPropertyAttributeNone, JSPropertyAttributeReadOnly
Constructor and Description |
---|
JSDataView(JSArrayBuffer buffer)
Creates a new DataView JavaScript object from ArrayBuffer 'buffer' and wraps it for Java
|
JSDataView(JSArrayBuffer buffer,
int byteOffset)
Creates a new DataView JavaScript object from ArrayBuffer 'buffer' starting from
'byteOffset' and wraps it for Java
|
JSDataView(JSArrayBuffer buffer,
int byteOffset,
int byteLength)
Creates a new DataView JavaScript object from ArrayBuffer 'buffer' starting from
'byteOffset' and wraps it for Java
|
JSDataView(JSObject view)
Treats an existing JSObject as a DataView.
|
Modifier and Type | Method and Description |
---|---|
JSArrayBuffer |
buffer()
JavasScript DataView.prototype.buffer, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/buffer
|
int |
byteLength()
JavasScript DataView.prototype.byteLength, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteLength
|
int |
byteOffset()
JavasScript DataView.prototype.byteOffset, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/byteOffset
|
java.lang.Float |
getFloat32(int byteOffset)
JavasScript DataView.prototype.getFloat32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32
|
java.lang.Float |
getFloat32(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getFloat32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat32
|
java.lang.Double |
getFloat64(int byteOffset)
JavasScript DataView.prototype.getFloat64(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64
|
java.lang.Double |
getFloat64(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getFloat64(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getFloat64
|
java.lang.Short |
getInt16(int byteOffset)
JavasScript DataView.prototype.getInt16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16
|
java.lang.Short |
getInt16(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getInt16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt16
|
java.lang.Integer |
getInt32(int byteOffset)
JavasScript DataView.prototype.getInt32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32
|
java.lang.Integer |
getInt32(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getInt32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt32
|
java.lang.Byte |
getInt8(int byteOffset)
JavasScript DataView.prototype.getInt8(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getInt8
|
JSObject |
getJSObject()
Gets underlying JSObject
|
java.lang.Short |
getUint16(int byteOffset)
JavasScript DataView.prototype.getUint16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16
|
java.lang.Short |
getUint16(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getUint16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint16
|
java.lang.Long |
getUint32(int byteOffset)
JavasScript DataView.prototype.getUint32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32
|
java.lang.Long |
getUint32(int byteOffset,
boolean littleEndian)
JavasScript DataView.prototype.getUint32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint32
|
java.lang.Byte |
getUint8(int byteOffset)
JavasScript DataView.prototype.getUint8(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/getUint8
|
void |
setFloat32(int byteOffset,
java.lang.Float value)
JavasScript DataView.prototype.setFloat32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32
|
void |
setFloat32(int byteOffset,
java.lang.Float value,
boolean littleEndian)
JavasScript DataView.prototype.setFloat32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat32
|
void |
setFloat64(int byteOffset,
java.lang.Double value)
JavasScript DataView.prototype.setFloat64(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64
|
void |
setFloat64(int byteOffset,
java.lang.Double value,
boolean littleEndian)
JavasScript DataView.prototype.setFloat64(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setFloat64
|
void |
setInt16(int byteOffset,
java.lang.Short value)
JavasScript DataView.prototype.setInt16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16
|
void |
setInt16(int byteOffset,
java.lang.Short value,
boolean littleEndian)
JavasScript DataView.prototype.setInt16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt16
|
void |
setInt32(int byteOffset,
java.lang.Integer value)
JavasScript DataView.prototype.setInt32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32
|
void |
setInt32(int byteOffset,
java.lang.Integer value,
boolean littleEndian)
JavasScript DataView.prototype.setInt32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt32
|
void |
setInt8(int byteOffset,
java.lang.Byte value)
JavasScript DataView.prototype.setInt8(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setInt8
|
void |
setUint16(int byteOffset,
java.lang.Short value)
JavasScript DataView.prototype.setUint16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16
|
void |
setUint16(int byteOffset,
java.lang.Short value,
boolean littleEndian)
JavasScript DataView.prototype.setUint16(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint16
|
void |
setUint32(int byteOffset,
java.lang.Long value)
JavasScript DataView.prototype.setUint32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32
|
void |
setUint32(int byteOffset,
java.lang.Long value,
boolean littleEndian)
JavasScript DataView.prototype.setUint32(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint32
|
void |
setUint8(int byteOffset,
java.lang.Byte value)
JavasScript DataView.prototype.setUint8(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/setUint8
|
__nullFunc, deleteProperty, getThis, hashCode, hasProperty, isConstructor, isFunction, property, property, property, propertyAtIndex, propertyAtIndex, propertyNames, prototype, prototype
equals, getContext, isArray, isBoolean, isDate, isEqual, isFloat32Array, isFloat64Array, isInstanceOfConstructor, isInt16Array, isInt32Array, isInt8Array, isNull, isNumber, isObject, isStrictEqual, isString, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, toBoolean, toFunction, toJSArray, toJSON, toNumber, toObject, toString, valueHash, valueRef
public JSDataView(JSArrayBuffer buffer)
buffer
- the JSArrayBuffer to create a DataView frompublic JSDataView(JSArrayBuffer buffer, int byteOffset)
buffer
- the JSArrayBuffer to create a DataView frombyteOffset
- the byte offset in 'buffer' to create the DataView frompublic JSDataView(JSArrayBuffer buffer, int byteOffset, int byteLength)
buffer
- the JSArrayBuffer to create a DataView frombyteOffset
- the byte offset in 'buffer' to create the DataView frombyteLength
- the length, in bytes, from 'byteOffset' to use for the DataViewpublic JSDataView(JSObject view)
view
- The DataView JSObject to wrappublic JSArrayBuffer buffer()
public int byteLength()
public int byteOffset()
public java.lang.Float getFloat32(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Float getFloat32(int byteOffset)
byteOffset
- the byte offset to read frompublic void setFloat32(int byteOffset, java.lang.Float value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setFloat32(int byteOffset, java.lang.Float value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Double getFloat64(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Double getFloat64(int byteOffset)
byteOffset
- the byte offset to read frompublic void setFloat64(int byteOffset, java.lang.Double value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setFloat64(int byteOffset, java.lang.Double value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Integer getInt32(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Integer getInt32(int byteOffset)
byteOffset
- the byte offset to read frompublic void setInt32(int byteOffset, java.lang.Integer value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setInt32(int byteOffset, java.lang.Integer value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Long getUint32(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Long getUint32(int byteOffset)
byteOffset
- the byte offset to read frompublic void setUint32(int byteOffset, java.lang.Long value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setUint32(int byteOffset, java.lang.Long value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Short getInt16(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Short getInt16(int byteOffset)
byteOffset
- the byte offset to read frompublic void setInt16(int byteOffset, java.lang.Short value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setInt16(int byteOffset, java.lang.Short value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Short getUint16(int byteOffset, boolean littleEndian)
byteOffset
- the byte offset to read fromlittleEndian
- whether the value is stored with little endiannesspublic java.lang.Short getUint16(int byteOffset)
byteOffset
- the byte offset to read frompublic void setUint16(int byteOffset, java.lang.Short value, boolean littleEndian)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'littleEndian
- whether the value is to be stored with little endiannesspublic void setUint16(int byteOffset, java.lang.Short value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Byte getInt8(int byteOffset)
byteOffset
- the byte offset to read frompublic void setInt8(int byteOffset, java.lang.Byte value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public java.lang.Byte getUint8(int byteOffset)
byteOffset
- the byte offset to read frompublic void setUint8(int byteOffset, java.lang.Byte value)
byteOffset
- the byte offset to write tovalue
- the value to store at 'byteOffset'public JSObject getJSObject()