Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

ArrayBuffer.prototype.transferToFixedLength()

2 tags 1 category

The transferToFixedLength() method of ArrayBuffer instances creates a new non-resizable ArrayBuffer with the same byte content as this buffer, then detaches this buffer.

Unlike transfer(), transferToFixedLength() always creates a non-resizable ArrayBuffer. This means newByteLength can be larger than the maxByteLength, even if this ArrayBuffer is resizable. See transferring ArrayBuffers for more information.

Return value: A new ArrayBuffer object. Its contents are initialized to the contents of this ArrayBuffer, and extra bytes, if any, are filled with zeros. The new ArrayBuffer is always non-resizable. The original ArrayBuffer is detached.

Parameters: newByteLength The byteLength of the new ArrayBuffer. Defaults to the byteLength of this ArrayBuffer. If newByteLength is smaller than the byteLength of this ArrayBuffer, the “overflowing” bytes are dropped. If newByteLength is larger than the byteLength of this ArrayBuffer, the extra bytes are filled with zeros.

Syntax example: transferToFixedLength()

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…