小编lil*_*ing的帖子

从缓冲区数据到字节数组的nodejs转换

我想将缓冲区数据转换为字节数组。这是我尝试过的

import * as fs from 'fs';
[...]
event:(data) => {
   fs.readFile(data, function(err, data) {
      var arrByte= new Uint8Array(data)
      var binaryData= new Blob([arrByte])
      console.log(binaryData)
   }
 }
Run Code Online (Sandbox Code Playgroud)

我的职位尚未发布。我非常想知道我在做什么,这是不对的。

arrays byte node.js typed-arrays

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

arrays ×1

byte ×1

node.js ×1

typed-arrays ×1