JavaScript ArrayBuffer Reference Last Updated : 18 Apr, 2025 Comments Improve Suggest changes Like Article Like Report ArrayBuffer is used to represent a generic, fixed-length raw binary data buffer. The contents of an ArrayBuffer cannot be directly manipulated and can only be accessed through a DataView Object or one of the typed array objects. These Objects are used to read and write the contents of the buffer. Syntax:new ArrayBuffer(byteLen)Parameters: It takes one parameter.byteLen: It is the byte length of the ArrayBuffer.Return Type: It returns an ArrayBuffer object.Example: This example creates an ArrayBuffer object JavaScript const buffer = new ArrayBuffer(8); const view = new Int32Array(buffer); console.log(view); OutputInt32Array(2) [ 0, 0 ]The complete list of JavaScript ArrayBuffer is listed below:JavaScript ArrayBuffer Constructor: In JavaScript, a constructor gets called when an object is created using the new keyword.ConstructorDescriptionArrayBuffer()Returns the ArrayBuffer objectJavaScript ArrayBuffer Properties: A JavaScript property is a member of an object that associates a key with a value. Instance Property: An instance property is a property that has a new copy for every new instance of the class.Instance PropertiesDescriptionconstructorReturns the ArrayBuffer constructor function for the objectbyteLengthSpecifies the byte length of the ArrayBuffermaxByteLengthSpecified the max length to which the size of ArrayBuffer can be increased in bytesresizableReturns a boolean which tells whether the array can be resizedJavaScript ArrayBuffer Methods: JavaScript methods are the actions that can be performed on objects. There are two types of Number methods in JavaScript.Static Methods: If the method is called using the ArrayBuffer class itself then it is called a static method.Static MethodsDescriptionisView() It checks given an argument for the function is a typed array or not.Instance Methods: If the method is called on an instance of an ArrayBuffer then it is called an instance method.Instance MethodsDescriptionresize()Resizes the ArrayBuffer if possibleslice()Returns new ArrayBuffer with the sliced value Comment More infoAdvertise with us Next Article JavaScript ArrayBuffer Reference kartik Follow Improve Article Tags : JavaScript Web Technologies Similar Reads JavaScript ArrayBuffer.prototype.transfer() Method The transfer() method of ArrayBuffer create a new ArrayBuffer that has the same byte content as the current buffer, then detach this current buffer, this means that merely the fresh buffer is able to get at the buried data and not any else. Such an option as transfer() comes in handy when there is a 2 min read JavaScript ArrayBuffer constructor Property JavaScript ArrayBuffer constructor property is used to return the ArrayBuffer constructor function for the object. The function returned by this property is just the reference, not the actual ArrayBuffer. It is an object property of JavaScript and can be used with Strings, Numbers, etc. Syntax: arra 1 min read JavaScript ArrayBuffer() Constructor JavaScript ArrayBuffer Constructor is used to create a new ArrayBuffer object. ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. This object can only be created with the new keyword. If the object is created without the new keyword it will throw a TypeError Synt 2 min read What is the Difference Between an Array and an ArrayBuffer? The arrays and ArrayBuffers serve different purposes and are used in the different contexts. While arrays are used for the general data storage and manipulation. The ArrayBuffers are used for the handling binary data. Understanding the differences between these two data structures is essential for t 2 min read IntBuffer array() method in Java The array() method of java.nio.IntBuffer Class is used to Return the int array that backs this buffer. Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa. Invoke() the hasArray() method are used before invoking this method in order to ensure 3 min read LongBuffer hasArray() method in Java The array() method of java.nio.LongBuffer Class is used to Return the Long array that backs this buffer. Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa. Invoke() the hasArray() method are used before invoking this method in order to ensu 2 min read DoubleBuffer array() method in Java With Examples The array() method of java.nio.DoubleBuffer Class is used to Return the double array that backs this buffer. Modifications to this bufferâs content will cause the returned arrayâs content to be modified, and vice versa. Invoke() the hasArray() method are used before invoking this method in order to 3 min read ByteBuffer array() method in Java with Examples The array() method of java.nio.ByteBuffer class is used to return the byte array that backs the taken buffer.Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa.Invoke the hasArray() method before invoking this method in order to ensure that 3 min read FloatBuffer array() method in Java With Examples The array() method of java.nio.FloatBuffer Class is used to Return the float array that backs this buffer. Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa. Invoke() the hasArray() method are used before invoking this method in order to en 3 min read ShortBuffer array() Method in Java with Examples The array() method of java.nio.ShortBuffer is used to return the short array that backs this buffer(optional). Modifications to this buffer's content will cause the returned array's content to be modified, and vice versa. Invoke the hasArray method before invoking this method in order to ensure that 3 min read Like