Tsts149 2022-03-18 11:56 采纳率: 55.2%
浏览 530
已结题

如何获取ArrayBuffer的Uint8Array?

问题遇到的现象和发生背景

img

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

2条回答 默认 最新

  • jartins 2022-03-25 21:04
    关注

    You have to pass the ArrayBuffer to the Uint8Array constructor

    You cannot directly manipulate the contents of an ArrayBuffer; instead, you create one of the typed array objects or a DataView object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
    

    new Uint8Array(arrayBuffer);

    img

    img

    简单来说 就是再一次使用 new Uint8Array(把你图中的buffer数据放到这里) 输出的就是 Uint8Array

    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 5月5日
  • 创建了问题 3月18日