readMutf8String

@JvmName(name = "readStringFrom")
fun Source.readMutf8String(): String(source)

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

In code, that would be:

val source = OkioMutf8Source(source = this)
val mutf8Length = source.readLength()
return source.readToString(mutf8Length)

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

See also