const buf = new Uint8Array(data)这样转换后,张图可以正常解码:{ type: 1, msg: 'pong'}第二张图解码后是空的:{ type: 0, msg:
顺晟科技
2021-10-03 13:45:11
211
const buf = new Uint8Array(data)
这样转换后,张图可以正常解码:{ type: 1, msg: 'pong'}
第二张图解码后是空的:{ type: 0, msg: ''}
protobufjs 生成的文件用的是 static-module 模式:npm pbjs -t static-module -w commonjs -o src/proto/proto.js src/proto/*.proto
顺晟科技:
这样应该怎么处理?相关问题 protobuf.js 浏览器 encode 后得到 uint8array,转化成的 arraybuffer 达到 8192bytes
没有问题,搞错了。。。。。。。