@@ -34,12 +34,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3434
3535/**
3636 * A wrapper class for a JavaScript ArrayBuffer
37+ * @since 3.0
3738 */
3839public class JSArrayBuffer {
3940 /**
4041 * Creates a new array buffer of 'length' bytes
4142 * @param ctx the JSContext in which to create the ArrayBuffer
4243 * @param length the length in bytes of the ArrayBuffer
44+ * @since 3.0
4345 */
4446 public JSArrayBuffer (JSContext ctx , int length ) {
4547 JSFunction constructor = new JSFunction (ctx ,"_ArrayBuffer" ,new String [] {"length" },
@@ -52,6 +54,7 @@ public JSArrayBuffer(JSContext ctx, int length) {
5254 * Treats an existing JSObject as an ArrayBuffer. It is up to the user to ensure the
5355 * underlying JSObject is actually an ArrayBuffer.
5456 * @param buffer The ArrayBuffer JSObject to wrap
57+ * @since 3.0
5558 */
5659 public JSArrayBuffer (JSObject buffer ) {
5760 mArrayBuffer = buffer ;
@@ -61,6 +64,7 @@ public JSArrayBuffer(JSObject buffer) {
6164 /**
6265 * Gets underlying JSObject
6366 * @return JSObject representing the ArrayBuffer
67+ * @since 3.0
6468 */
6569 public JSObject getJSObject () {
6670 return mArrayBuffer ;
@@ -70,6 +74,7 @@ public JSObject getJSObject() {
7074 * JavaScript: ArrayBuffer.prototype.byteLength, see:
7175 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/byteLength
7276 * @return length of ArrayBuffer in bytes
77+ * @since 3.0
7378 */
7479 public int byteLength () {
7580 return mArrayBuffer .property ("byteLength" ).toNumber ().intValue ();
@@ -81,6 +86,7 @@ public int byteLength() {
8186 * @param arg the argument to be checked
8287 * @return true if arg is one of the ArrayBuffer views, such as typed array objects or
8388 * a DataView; false otherwise
89+ * @since 3.0
8490 */
8591 public static boolean isView (JSValue arg ) {
8692 return arg .getContext ().property ("ArrayBuffer" ).toObject ().property ("isView" ).toFunction ()
@@ -93,6 +99,7 @@ public static boolean isView(JSValue arg) {
9399 * @param oldBuffer An ArrayBuffer object from which to transfer from
94100 * @param newByteLength The byte length of the new ArrayBuffer object
95101 * @return a new ArrayBuffer
102+ * @since 3.0
96103 */
97104 public static JSArrayBuffer transfer (JSArrayBuffer oldBuffer , int newByteLength ) {
98105 return new JSArrayBuffer (oldBuffer .getJSObject ().getContext ().property ("ArrayBuffer" ).toObject ()
@@ -103,6 +110,7 @@ public static JSArrayBuffer transfer(JSArrayBuffer oldBuffer, int newByteLength)
103110 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer
104111 * @param oldBuffer An ArrayBuffer object from which to transfer from
105112 * @return a new ArrayBuffer
113+ * @since 3.0
106114 */
107115 public static JSArrayBuffer transfer (JSArrayBuffer oldBuffer ) {
108116 return new JSArrayBuffer (oldBuffer .getJSObject ().getContext ().property ("ArrayBuffer" ).toObject ()
@@ -115,6 +123,7 @@ public static JSArrayBuffer transfer(JSArrayBuffer oldBuffer) {
115123 * @param begin Zero-based byte index at which to begin slicing
116124 * @param end Byte index to end slicing
117125 * @return new ArrayBuffer with sliced contents copied
126+ * @since 3.0
118127 */
119128 public JSArrayBuffer slice (int begin , int end ) {
120129 return new JSArrayBuffer (
@@ -125,6 +134,7 @@ public JSArrayBuffer slice(int begin, int end) {
125134 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice
126135 * @param begin Zero-based byte index at which to begin slicing
127136 * @return new ArrayBuffer with sliced contents copied
137+ * @since 3.0
128138 */
129139 public JSArrayBuffer slice (int begin ) {
130140 return new JSArrayBuffer (
0 commit comments