class
string_decoder.StringDecoder
class StringDecoder
- end(buffer?: string | ArrayBufferView<ArrayBufferLike>): string;
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
bufferargument is provided, one final call tostringDecoder.write()is performed before returning the remaining input. Afterend()is called, thestringDecoderobject can be reused for new input.@param bufferThe bytes to decode.
- buffer: string | ArrayBufferView<ArrayBufferLike>): string;
Returns a decoded string, ensuring that any incomplete multibyte characters at the end of the
Buffer, orTypedArray, orDataVieware omitted from the returned string and stored in an internal buffer for the next call tostringDecoder.write()orstringDecoder.end().@param bufferThe bytes to decode.