Node.js stringDecoder.write() Method
The stringDecoder.write() method is used to return a decoded string from the given Buffer, TypedArray or DataView. This method also ensures that any incomplete multibyte characters at the end of the buffer are omitted from the returned string. These characters are stored in an internal buffer for the next call to the
stringDecoder.write( buffer )
Parameters: This method accepts single parameter as mentioned above and described below:
- buffer: It is a Buffer, TypedArray or DataView that contains the bytes that have to be decoded.
Return Value: It returns a string which is decoded from the given buffer.
Below programs illustrate the stringDecoder.write() method in Node.js:
Decoded Text: GeeksforGeeks
Decoded Text Hex: GeeksforGeeks Decoded Text Base64: GeeksforGeeks Cent Symbol: ¢
My Personal Notes arrow_drop_up
Please Login to comment...