Object StringDecoder
Stream decoding object
inheritance relationship
Constructor
StringDecoder
Decoder constructor
1new StringDecoder(String encoding = "utf8");
Call parameters:
- encoding: String, decoding encoding. Default is 'utf8'.
member properties
lastNeed
Integer, used internally.
1Integer StringDecoder.lastNeed;
lastTotal
Integer, used internally.
1Integer StringDecoder.lastTotal;
lastChar
Buffer, internal use.
1Buffer StringDecoder.lastChar;
encoding
String, decoding encoding. Internal use.
1String StringDecoder.encoding;
member function
end
Return the internally stored buffer as characters. Incomplete UTF-8 and UTF-16 bytes are attempted to be completed.
1String StringDecoder.end();
Return results:
- String, the decoded string.
Return the internally stored buffer as characters. Incomplete UTF-8 and UTF-16 bytes are attempted to be completed.
1String StringDecoder.end(Buffer buf);
Call parameters:
- buf:Buffer, need to be decodedBuffer. Before executing end, write will be called to write the buffer.
Return results:
- String, the decoded string.
write
Returns a decoded string, ensuring that any incomplete trailing characters are omitted and are not returned this time, but are stored internally for use by the next write or end method.
1String StringDecoder.write(Buffer buf);
Call parameters:
Return results:
- String, the decoded string.
text
internal use. .
1
2String StringDecoder.text(Buffer buf,
Integer offset);
Call parameters:
Return results:
- String, the decoded string.
fillLast
internal use. .
1String StringDecoder.fillLast(Buffer buf);
Call parameters:
Return results:
- String, the decoded string.
toString
Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.
1String StringDecoder.toString();
Return results:
- String, returns the string representation of the object
toJSON
Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.
1Value StringDecoder.toJSON(String key = "");
Call parameters:
- key: String, not used
Return results:
- Value, returns a value containing JSON serializable