You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
447 B
17 lines
447 B
2 months ago
|
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;
|