Module org.htmlunit.corejs
Class NativeArrayBuffer
java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer
- All Implemented Interfaces:
Serializable,ConstProperties<Scriptable>,DebuggableObject,PropHolder<Scriptable>,Scriptable,SymbolScriptable
A NativeArrayBuffer is the backing buffer for a typed array. Used inside JavaScript code, it
implements the ArrayBuffer interface. Used directly from Java, it simply holds a byte array.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.DescriptorInfo, ScriptableObject.KeyComparator, ScriptableObject.LambdaGetterFunction, ScriptableObject.LambdaSetterFunction -
Field Summary
FieldsFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, LEGACY_CONST, PERMANENT, READONLY, STRICTLY_READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty buffer.NativeArrayBuffer(double len) Create a buffer of the specified length in bytes. -
Method Summary
Modifier and TypeMethodDescriptionvoiddetach()byte[]Deprecated.This method will return null for shared buffers and possibly other buffers in the future.Return a buffer that points to the contents.Return the name of the class.intGet the number of bytes in the buffer.static ObjectbooleanbooleanReturn true if this ArrayBuffer is resizable (ES2024).Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Field Details
-
CLASS_NAME
- See Also:
-
byteOrder
-
-
Constructor Details
-
NativeArrayBuffer
public NativeArrayBuffer()Create an empty buffer. -
NativeArrayBuffer
public NativeArrayBuffer(double len) Create a buffer of the specified length in bytes.
-
-
Method Details
-
getClassName
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
init
-
getLength
public int getLength()Get the number of bytes in the buffer. -
getBuffer
Deprecated.This method will return null for shared buffers and possibly other buffers in the future. Callers should usegetByteBuffer()instead.Return the actual bytes that back the buffer. This is a reference to the real buffer, so changes to bytes here will be reflected in the actual object and all its views. In the future, for a shared array buffer this will return null -- callers should use getByteBuffer() instead. -
getByteBuffer
Return a buffer that points to the contents. The position will be zero and the limit will be the length of the buffer. The buffer is returned usingBuffer.duplicate(). -
detach
public void detach() -
isDetached
public boolean isDetached() -
isResizable
public boolean isResizable()Return true if this ArrayBuffer is resizable (ES2024).
-