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

如何获取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日

悬赏问题

  • ¥20 在进行keil5环境中ti芯片可移植性验证出现了如图所示错误(参考的是立创和无名的视频)
  • ¥15 treelib库有读取树数据方法吗?
  • ¥15 咨询一个PYTHON的问题
  • ¥15 机器学习建模调参,roc评价指标
  • ¥15 RCS plot 包内置数据集使用时报错,如何解决?
  • ¥15 keil+mspm0g3507+二维总线舵机
  • ¥15 如何用wireshark分析找出url接口和param参数
  • ¥15 有谁知道这是阿里云那个应用的域名吗,怎么调用?
  • ¥30 正则表达式的一些问题
  • ¥15 C#如何使用不需要安装 Microsoft Excel 的机器上的方法或者库实现:将指定Excel区域导出为图片(例如A1:AO50)