Bun

指南二進位制資料

使用 Bun 將 DataView 轉換為字串

如果 DataView 包含 ASCII 編碼的文字,您可以使用 TextDecoder 類將其轉換為字串。

const dv: DataView = ...;
const decoder = new TextDecoder();
const str = decoder.decode(dv);

有關使用 Bun 操作二進位制資料的完整文件,請參閱 文件 > API > 二進位制資料