readMutf8Array

@JvmName(name = "readArrayFrom")
fun Input.readMutf8Array(): CharArray(source)

Creates a InputMutf8Source around the receiver, reads the length & contents of a Modified UTF-8 string, and then returns the contents as a CharArray.

In code, that would be:

val source = InputMutf8Source(input = this)
val mutf8Length = source.readLength()
return source.readToArray(mutf8Length)

All IOExceptions, EOFExceptions, and UTFDataFormatExceptions documented on those methods apply to this function too.

See also