mirror of
https://git.unlock-music.dev/um/web.git
synced 2025-03-13 22:44:39 +08:00
16 lines
330 B
TypeScript
16 lines
330 B
TypeScript
export function MergeUint8Array(array: Uint8Array[]): Uint8Array {
|
|
let length = 0;
|
|
array.forEach((item) => {
|
|
length += item.length;
|
|
});
|
|
|
|
let mergedArray = new Uint8Array(length);
|
|
let offset = 0;
|
|
array.forEach((item) => {
|
|
mergedArray.set(item, offset);
|
|
offset += item.length;
|
|
});
|
|
|
|
return mergedArray;
|
|
}
|