GT2/GT2-iOS/node_modules/lodash-es/_cloneArrayBuffer.js

17 lines
447 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
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;