如果 DataView 包含 ASCII 編碼的文本,你可以使用 TextDecoder 類將其轉換為字符串。
ts
const dv: DataView = ...;
const decoder = new TextDecoder();
const str = decoder.decode(dv);有關使用 Bun 操作二進制數據的完整文檔,請參閱 文檔 > API > 二進制數據。