stringDecoder.write(buffer)


返回解码的字符串,会确保返回的字符串不会包含 BufferTypedArrayDataView 末尾中的任何不完整的多字节字符,并且会将不完整的字符保存在内部的 buffer 中用于下次调用 stringDecoder.write()stringDecoder.end()

Returns a decoded string, ensuring that any incomplete multibyte characters at the end of the Buffer, or TypedArray, or DataView are omitted from the returned string and stored in an internal buffer for the next call to stringDecoder.write() or stringDecoder.end().