如果 DataView 包含 ASCII 編碼的文字,您可以使用 TextDecoder 類將其轉換為字串。
const dv: DataView = ...;
const decoder = new TextDecoder();
const str = decoder.decode(dv);
有關使用 Bun 操作二進位制資料的完整文件,請參閱 文件 > API > 二進位制資料。
如果 DataView 包含 ASCII 編碼的文字,您可以使用 TextDecoder 類將其轉換為字串。
const dv: DataView = ...;
const decoder = new TextDecoder();
const str = decoder.decode(dv);
有關使用 Bun 操作二進位制資料的完整文件,請參閱 文件 > API > 二進位制資料。
HTTP
包管理器
將 bun install 與 Artifactory 一起使用
配置 Git 以 diff Bun 的 lockb lockfile
讀取檔案
執行時
流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
實用程式