UNPKG

loaders.gl

Version:

Framework-independent loaders for 3D graphics formats

27 lines (23 loc) 880 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.padTo4Bytes = padTo4Bytes; exports.copyArrayBuffer = copyArrayBuffer; function padTo4Bytes(byteLength) { return byteLength + 3 & ~3; } /* Creates a new Uint8Array based on two different ArrayBuffers * @private * @param {ArrayBuffers} buffer1 The first buffer. * @param {ArrayBuffers} buffer2 The second buffer. * @return {ArrayBuffers} The new ArrayBuffer created out of the two. */ function copyArrayBuffer(targetBuffer, sourceBuffer, byteOffset) { var byteLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sourceBuffer.byteLength; var targetArray = new Uint8Array(targetBuffer, byteOffset, byteLength); var sourceArray = new Uint8Array(sourceBuffer); targetArray.set(sourceArray); return targetBuffer; } //# sourceMappingURL=array-utils.js.map