Expand description
Node string_decoder core module: new StringDecoder(encoding) with
.write(buffer) / .end([buffer]). A StringDecoder turns byte chunks into a
string, holding back an incomplete trailing multibyte sequence until the next
chunk completes it.
Every encoding that has a chunk boundary buffers across it: UTF-8 holds an incomplete trailing sequence, UTF-16LE holds an odd byte and a trailing high surrogate, and base64 holds up to two bytes so it only ever emits whole 3-byte groups. The single-byte encodings consume everything.
Constants§
- INSTANCE_
METHODS - The methods a
StringDecoderinstance carries. Also the method set its real prototype object is built from, so a read (sd.write), a call (sd.write(b)) and a prototype lookup (StringDecoder.prototype.write) cannot disagree.
Functions§
- construct
new StringDecoder([encoding]).- instance_
call