将 BufferSource 转换为 ArrayBuffer。
需要转换的 BufferSource。
ArrayBuffer。
const u8a = new Uint8Array([1, 2, 3]);const ab = bufferSource2Ab(u8a);console.log(ab.byteLength); // 3 Copy
const u8a = new Uint8Array([1, 2, 3]);const ab = bufferSource2Ab(u8a);console.log(ab.byteLength); // 3
将 BufferSource 转换为 ArrayBuffer。