Mutf8Source
Something that Modified UTF-8 data can be read from.
For convenience in various scenarios, said data can be accessed in several ways:
readToAppendable: The characters are added to an existing Appendable, such as a StringBuilder
readToString: The characters are read and returned as a String
readToArray: The characters are read and returned as a CharArray
All the aforementioned methods require the mutf8Length
to be known in advance, which is the total number of bytes that the characters are encoded in. In standard Modified UTF-8 data, the mutf8Length
is encoded as an unsigned, big-endian, 16-bit integer, and is encoded immediately before the first character's bytes, if any. It can be read using readLength.
Constructors
Functions
Reads the length of a Modified UTF-8 string from the source of data.
Reads a Modified UTF-8 string from the source and appends each of its characters, in order, to an Appendable, such as a StringBuilder.
Reads a Modified UTF-8 string from the source and returns its characters as a CharArray in their original order.
Reads a Modified UTF-8 string from the source and returns it as a String.