Class ArrayBufferLibrary
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.library.Library
com.oracle.truffle.js.api.ArrayBufferLibrary
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
public abstract class ArrayBufferLibrary
extends com.oracle.truffle.api.library.Library
ArrayBuffer library provides operations on and information about JavaScript
ArrayBuffer
objects.-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetByteLength(Object arrayBuffer) Returns the byte length of thearrayBuffer.getContents(Object arrayBuffer) Returns the content of thearrayBuffer.static com.oracle.truffle.api.library.LibraryFactory<ArrayBufferLibrary> Returns the library factory for the ArrayBuffer library.static ArrayBufferLibraryReturns the uncached automatically dispatched version of the ArrayBuffer library.booleanisArrayBuffer(Object object) Returnstrueif theobjectis JavaScriptArrayBuffer, returnsfalseotherwise.Methods inherited from class com.oracle.truffle.api.library.Library
acceptsMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Constructor Details
-
ArrayBufferLibrary
public ArrayBufferLibrary()
-
-
Method Details
-
getFactory
Returns the library factory for the ArrayBuffer library. -
getUncached
Returns the uncached automatically dispatched version of the ArrayBuffer library. -
isArrayBuffer
Returnstrueif theobjectis JavaScriptArrayBuffer, returnsfalseotherwise. -
getContents
public ByteBuffer getContents(Object arrayBuffer) throws com.oracle.truffle.api.interop.UnsupportedMessageException Returns the content of thearrayBuffer. ThrowsUnsupportedMessageExceptionwhen the receiver is notisArrayBuffer(Object). ReturnsnullwhenarrayBufferis detached. May also returnnullwhenarrayBufferwraps non-JavaScript buffer.- Throws:
com.oracle.truffle.api.interop.UnsupportedMessageException
-
getByteLength
public int getByteLength(Object arrayBuffer) throws com.oracle.truffle.api.interop.UnsupportedMessageException Returns the byte length of thearrayBuffer. ThrowsUnsupportedMessageExceptionwhen the receiver is notisArrayBuffer(Object).- Throws:
com.oracle.truffle.api.interop.UnsupportedMessageException
-