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() 后触发。
如果 textDecoder.fatal 是 true,则发生的解码错误将导致抛出 TypeError。
input<ArrayBuffer> | <DataView> | <TypedArray> AnArrayBuffer,DataView, orTypedArrayinstance containing the encoded data.options<Object>stream<boolean>trueif additional chunks of data are expected. Default:false.
- Returns: <string>
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().
If textDecoder.fatal is true, decoding errors that occur will result in a
TypeError being thrown.