WebAdmin File Manager
Linux 5.15.0-164-generic · PHP 8.2.27

View: _cloneArrayBuffer.js

Edit Download Back
import Uint8Array from './_Uint8Array.js';

/**
 * Creates a clone of `arrayBuffer`.
 *
 * @private
 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
 * @returns {ArrayBuffer} Returns the cloned array buffer.
 */
function cloneArrayBuffer(arrayBuffer) {
  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  return result;
}

export default cloneArrayBuffer;
Size: 447 BMIME: text/x-javaLines: 16

Rename Item