ArrayBuffer object is used to represent a generic, fixed-length raw binary data buffer. You can not directly manipulate the contents of an
ArrayBuffer; instead, you create one of the typed array objects or a
DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
- The size, in bytes, of the array buffer to create.
ArrayBuffer object of the specified size. Its contents are initialized to 0.
ArrayBuffer constructor creates a new
ArrayBuffer of the given length in bytes.
Getting an array buffer from existing data
ArrayBufferconstructor's length property whose value is 1.
- Allows the addition of properties to all
argis one of the ArrayBuffer views, such as typed array objects or a
ArrayBuffer.transfer(oldBuffer [, newByteLength])
Returns a new
ArrayBufferwhose contents are taken from the
oldBuffer's data and then is either truncated or zero-extended by
ArrayBuffer instances inherit from
Specifies the function that creates an object's prototype. The initial value is the standard built-in
- The size, in bytes, of the array. This is established when the array is constructed and cannot be changed. Read only.
Returns a new
ArrayBufferwhose contents are a copy of this
ArrayBuffer's bytes from
begin, inclusive, up to
end, exclusive. If either
endis negative, it refers to an index from the end of the array, as opposed to from the beginning.
In this example, we create a 8-byte buffer with a
Int32Array view referring to the buffer:
var buffer = new ArrayBuffer(8); var view = new Int32Array(buffer);
|Typed Array Specification||Obsolete||Superseded by ECMAScript 6.|
|ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'ArrayBuffer' in that specification.
|Standard||Initial definition in an ECMA standard.|
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|Basic support||7.0||4.0 (2)||10||11.6||5.1|
|Feature||Android||Chrome for Android||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Safari Mobile|
|Basic support||4.0||(Yes)||4.0 (2)||10||11.6||4.2|