UNPKG

loaders.gl

Version:

Framework-independent loaders for 3D graphics formats

18 lines (17 loc) 734 B
export 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. */ export 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