com.gargoylesoftware.htmlunit.javascript.host.arrays
Class DataView

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView
              extended by com.gargoylesoftware.htmlunit.javascript.host.arrays.DataView
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class DataView
extends ArrayBufferView

The ArrayBufferView type describes a particular view on the contents of an ArrayBuffer's data.

Version:
$Revision: 7942 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
DataView()
           
 
Method Summary
 void constructor(ArrayBuffer array, int byteOffset, Object length)
          JavaScript constructor.
 float getFloat32(int byteOffset, boolean littleEndian)
          Gets a 32-bit floating point number at the specified byte offset from the start of the view.
 double getFloat64(int byteOffset, boolean littleEndian)
          Gets a 64-bit floating point number at the specified byte offset from the start of the view.
 short getInt16(int byteOffset, boolean littleEndian)
          Gets a signed 16-bit integer at the specified byte offset from the start of the view.
 int getInt32(int byteOffset, boolean littleEndian)
          Gets a signed 32-bit integer at the specified byte offset from the start of the view.
 byte getInt8(int byteOffset)
          Gets a signed 8-bit integer at the specified byte offset from the start of the view.
 int getUint16(int byteOffset, boolean littleEndian)
          Gets an unsigned 16-bit integer at the specified byte offset from the start of the view.
 long getUint32(int byteOffset, boolean littleEndian)
          Gets an unsigned 32-bit integer at the specified byte offset from the start of the view.
 int getUint8(int byteOffset)
          Gets an unsigned 8-bit integer at the specified byte offset from the start of the view.
 void setFloat32(int byteOffset, double value, boolean littleEndian)
          Sets the given 32-bit floating point number at the specified offset.
 void setFloat64(int byteOffset, double value, boolean littleEndian)
          Sets the given 32-bit floating point number at the specified offset.
 void setInt16(int byteOffset, int value, boolean littleEndian)
          Sets the given signed 16-bit integer at the specified offset.
 void setInt32(int byteOffset, int value, boolean littleEndian)
          Sets the given signed 32-bit integer at the specified offset.
 void setInt8(int byteOffset, int value)
          Sets the given signed 8-bit integer at the specified offset.
 void setUint16(int byteOffset, int value, boolean littleEndian)
          Sets the given unsigned 16-bit integer at the specified offset.
 void setUint32(int byteOffset, int value, boolean littleEndian)
          Sets the given unsigned 32-bit integer at the specified offset.
 void setUint8(int byteOffset, int value)
          Sets the given unsigned 8-bit integer at the specified offset.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferView
constructor, getBuffer, getByteLength, getByteOffset, setBuffer, setByteLength
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataView

public DataView()
Method Detail

constructor

public void constructor(ArrayBuffer array,
                        int byteOffset,
                        Object length)
JavaScript constructor.

Parameters:
array - the array
byteOffset - the byte offset
length - the length

getInt8

public byte getInt8(int byteOffset)
Gets a signed 8-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
Returns:
the byte

setInt8

public void setInt8(int byteOffset,
                    int value)
Sets the given signed 8-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value

getInt16

public short getInt16(int byteOffset,
                      boolean littleEndian)
Gets a signed 16-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setInt16

public void setInt16(int byteOffset,
                     int value,
                     boolean littleEndian)
Sets the given signed 16-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format

getInt32

public int getInt32(int byteOffset,
                    boolean littleEndian)
Gets a signed 32-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setInt32

public void setInt32(int byteOffset,
                     int value,
                     boolean littleEndian)
Sets the given signed 32-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format

getUint8

public int getUint8(int byteOffset)
Gets an unsigned 8-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
Returns:
the value

setUint8

public void setUint8(int byteOffset,
                     int value)
Sets the given unsigned 8-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value

getUint16

public int getUint16(int byteOffset,
                     boolean littleEndian)
Gets an unsigned 16-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setUint16

public void setUint16(int byteOffset,
                      int value,
                      boolean littleEndian)
Sets the given unsigned 16-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format

getUint32

public long getUint32(int byteOffset,
                      boolean littleEndian)
Gets an unsigned 32-bit integer at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setUint32

public void setUint32(int byteOffset,
                      int value,
                      boolean littleEndian)
Sets the given unsigned 32-bit integer at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format

getFloat32

public float getFloat32(int byteOffset,
                        boolean littleEndian)
Gets a 32-bit floating point number at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setFloat32

public void setFloat32(int byteOffset,
                       double value,
                       boolean littleEndian)
Sets the given 32-bit floating point number at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format

getFloat64

public double getFloat64(int byteOffset,
                         boolean littleEndian)
Gets a 64-bit floating point number at the specified byte offset from the start of the view.

Parameters:
byteOffset - the byte offset
littleEndian - whether the value is stored in little- or big-endian format
Returns:
the value

setFloat64

public void setFloat64(int byteOffset,
                       double value,
                       boolean littleEndian)
Sets the given 32-bit floating point number at the specified offset.

Parameters:
byteOffset - the byte offset
value - the value
littleEndian - whether the value is stored in little- or big-endian format


Copyright © 2002–2013 Gargoyle Software Inc.. All rights reserved.