textDecoder.decode([input[, options]])
input<ArrayBuffer> | <DataView> | <TypedArray> 一个包含编码数据的ArrayBuffer、DataView或TypedArray实例。options<Object>stream<boolean>true如果预计会有额外的数据块。 默认值:false。
- 返回:<string>
解码 input 并返回一个字符串。如果 options.stream 为 true,则任何出现在 input 末尾的不完整字节序列都会在内部缓存,并在下一次调用 textDecoder.decode() 后输出。
🌐 Decodes the input and returns a string. If options.stream is true, any
incomplete byte sequences occurring at the end of the input are buffered
internally and emitted after the next call to textDecoder.decode().
如果 textDecoder.fatal 为 true,发生的解码错误将会抛出 TypeError。
🌐 If textDecoder.fatal is true, decoding errors that occur will result in a
TypeError being thrown.