Class NativeArrayBufferView

java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.typedarrays.NativeArrayBufferView
All Implemented Interfaces:
Serializable, ConstProperties, DebuggableObject, Scriptable, SymbolScriptable
Direct Known Subclasses:
NativeDataView, NativeTypedArrayView

public abstract class NativeArrayBufferView extends ScriptableObject
This class is the abstract parent for all views of the array. It shows a view of the underlying NativeArrayBuffer. Many views may simultaneously share the same buffer, and changes to one will affect all.
See Also:
  • Field Details

    • arrayBuffer

      protected final NativeArrayBuffer arrayBuffer
      Many view objects can share the same backing array
    • offset

      protected final int offset
      The offset, in bytes, from the start of the backing array
    • byteLength

      protected final int byteLength
      The length, in bytes, of the portion of the backing array that we use
  • Constructor Details

    • NativeArrayBufferView

      public NativeArrayBufferView()
    • NativeArrayBufferView

      protected NativeArrayBufferView(NativeArrayBuffer ab, int offset, int byteLength)
  • Method Details

    • getBuffer

      public NativeArrayBuffer getBuffer()
      Return the buffer that backs this view.
    • getByteOffset

      public int getByteOffset()
      Return the offset in bytes from the start of the buffer that this view represents.
    • getByteLength

      public int getByteLength()
      Return the length, in bytes, of the part of the buffer that this view represents.
    • useLittleEndian

      protected static boolean useLittleEndian()
    • isArg

      protected static boolean isArg(Object[] args, int i)
    • get

      public Object get(Symbol key, Scriptable start)
      Description copied from class: ScriptableObject
      Another version of Get that supports Symbol keyed properties.
      Specified by:
      get in interface SymbolScriptable
      Overrides:
      get in class ScriptableObject