以字符串的形式返回保存在内部 buffer 中的所有的剩余的输入。 不完整的 UTF-8 和 UTF-16 字符的字节将会被替换为适合字符编码的替代字符。

如果提供了 buffer 参数,则在返回剩余的输入之前会再最后一次调用 stringDecoder.write()

Returns any remaining input stored in the internal buffer as a string. Bytes representing incomplete UTF-8 and UTF-16 characters will be replaced with substitution characters appropriate for the character encoding.

If the buffer argument is provided, one final call to stringDecoder.write() is performed before returning the remaining input.