Skip to content

Instantly share code, notes, and snippets.

@pedrouid
Last active December 17, 2018 18:17
Show Gist options
  • Select an option

  • Save pedrouid/b2eb28aef42bf11f60463498956c759b to your computer and use it in GitHub Desktop.

Select an option

Save pedrouid/b2eb28aef42bf11f60463498956c759b to your computer and use it in GitHub Desktop.
Concat ArrayBuffers
function concatBuffer(b1, b2) {
let r = new Uint8Array(b1.byteLength + b2.byteLength);
r.set(new Uint8Array(b1), 0);
r.set(new Uint8Array(b2), b1.byteLength);
return r.buffer;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment