textDecoder.decode([input[, options]])
-
input
<ArrayBuffer> | <DataView> | <TypedArray> 包含编码数据的ArrayBuffer
、DataView
或TypedArray
实例。¥
input
<ArrayBuffer> | <DataView> | <TypedArray> AnArrayBuffer
,DataView
, orTypedArray
instance containing the encoded data. -
options
<Object> -
返回:<string>
¥Returns: <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.