More than one DataView or typed array objects can be added to one ArrayBuffer and any changes to one object can be easily seen by the other object’s view. The following are the typed arrays: Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array.
Parameters: It accepts one parameter.
- bytelength: It denotes the size, in bytes, of the array buffer to be created.
Return value: It returns a new ArrayBuffer object of the specified size and the content is initialized to 0.
76543210 76 76
- ArrayBuffer.byteLength: The byteLength property returns the length of the buffer in bytes.
- ArrayBuffer.prototype: This property allows the addition of properties to all ArrayBuffer objects.
- ArrayBuffer.isView(arg): If arg is one of the ArrayBuffer views (typed array objects or a DataView) then true is returned otherwise, false is returned.
- ArrayBuffer.transfer(oldBuffer [, newByteLength]): The contents from the oldbuffer specified is either truncated or zero-extended by the specified newByteLength and is returned as a new ArrayBuffer.
- ArrayBuffer.slice() and ArrayBuffer.prototype.slice(): A new ArrayBuffer is returned whose contents are a copy of this ArrayBuffer’s bytes from begin, inclusive, up to end, exclusive.
Please Login to comment...