It was so simple:
var array_of_arraybuffer = [ArrayBuffer(30),[ArrayBuffer(30)]; // Contain sliced ArrayBuffer
Step 1: Loop Through : Chunk of ArrayBuffer : array_of_arraybuffer (i)
Step 2: var merged_ab = new Uint16Array(); //In Every ith-iteration
Step 3: Pull ith element from array of arraybuffer
var j=0,len=array_of_arraybuffer[i].length; for(j=0;j<len;j++){
var tmp = new Uint8Array(merged_ab.byteLength + array_of_arraybuffer[i].byteLength); tmp.set(new Uint8Array(merged_ab), 0); tmp.set(new Uint8Array(array_of_arraybuffer[i]), merged_ab.byteLength); merged_ab=tmp; }
Step 4: /Check merged_ab.byteLength with array_of_arraybuffer[i] 's total size if it matched then it worked perfectly/
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It was so simple:
var array_of_arraybuffer = [ArrayBuffer(30),[ArrayBuffer(30)]; // Contain sliced ArrayBuffer
Step 1:
Loop Through : Chunk of ArrayBuffer : array_of_arraybuffer (i)
Step 2:
var merged_ab = new Uint16Array(); //In Every ith-iteration
Step 3:
Pull ith element from array of arraybuffer
var j=0,len=array_of_arraybuffer[i].length;
for(j=0;j<len;j++){
var tmp = new Uint8Array(merged_ab.byteLength + array_of_arraybuffer[i].byteLength);
tmp.set(new Uint8Array(merged_ab), 0);
tmp.set(new Uint8Array(array_of_arraybuffer[i]), merged_ab.byteLength);
merged_ab=tmp;
}
Step 4:
/Check merged_ab.byteLength with array_of_arraybuffer[i] 's total size if it matched then it worked perfectly/