readMutf8ToAppendable

@JvmName(name = "readToAppendableFrom")
fun InputStream.readMutf8ToAppendable(destination: Appendable)(source)

Creates a StreamMutf8Source around the receiver, reads the length & contents of a Modified UTF-8 string, and then writes those contents to the supplied destination, such as a StringBuilder.

In code, that would be:

val source = StreamMutf8Source(stream = this)
val mutf8Length = source.readLength()
return source.readToAppendable(mutf8Length, destination)

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

See also