UNPKG

@loaders.gl/core

Version:

Framework-independent loaders for 3D graphics formats

9 lines (8 loc) 421 B
export function concatenateArrayBuffers(source1, source2) { const sourceArray1 = source1 instanceof ArrayBuffer ? new Uint8Array(source1) : source1; const sourceArray2 = source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2; const temp = new Uint8Array(sourceArray1.byteLength + sourceArray2.byteLength); temp.set(sourceArray1, 0); temp.set(sourceArray2, sourceArray1.byteLength); return temp; }