Buffer 類擴展了 Uint8Array,提供了許多額外的方法。使用 Buffer.from() 從 Uint8Array 創建 Buffer 實例。
ts
const arr: Uint8Array = ...
const buf = Buffer.from(arr);有關使用 Bun 操作二進制數據的完整文檔,請參閱 文檔 > API > 二進制數據。
Buffer 類擴展了 Uint8Array,提供了許多額外的方法。使用 Buffer.from() 從 Uint8Array 創建 Buffer 實例。
const arr: Uint8Array = ...
const buf = Buffer.from(arr);有關使用 Bun 操作二進制數據的完整文檔,請參閱 文檔 > API > 二進制數據。