Mutf8Source

abstract class Mutf8Source(source)

Something that Modified UTF-8 data can be read from.

For convenience in various scenarios, said data can be accessed in several ways:

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

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun readLength(): Int

Reads the length of a Modified UTF-8 string from the source of data.

Link copied to clipboard
fun readToAppendable(mutf8Length: Int, destination: Appendable)

Reads a Modified UTF-8 string from the source and appends each of its characters, in order, to an Appendable, such as a StringBuilder.

Link copied to clipboard
fun readToArray(mutf8Length: Int): CharArray

Reads a Modified UTF-8 string from the source and returns its characters as a CharArray in their original order.

Link copied to clipboard
fun readToString(mutf8Length: Int): String

Reads a Modified UTF-8 string from the source and returns it as a String.

Inheritors

Link copied to clipboard