ArrayBuffer對象:存儲二進制數據的一段內存,不能寫/讀 ,類似數組的對象
只能通過TypedArray視圖/DataView視圖 讀/寫
va buf = new ArrayBuffer(32)
var dataview = new DataView(buf);
dataview.getUint(8)
TypedArray視圖/DataView視圖 區別:
TypedArray視圖表示一組構造函數:
new Int32Array(buf)
new Unit8Array(buf)
很多瀏覽器API用到:
File API
XMLHttpRequest
Fetch API
Canvas
WebSockets