writeMutf8Sequence

@JvmName(name = "writeSequenceTo")
fun Output.writeMutf8Sequence(characters: CharSequence, startIndex: Int = 0, endIndex: Int = characters.length, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)(source)

Creates a OutputMutf8Sink around the receiver, writes the mutf8Length of the characters, and then writes the characters themselves.

In code, that would be:

val mutf8Length = characters.mutf8Length(startIndex, endIndex)
val sink = OkioMutf8Sink(output = this, bytesPerWrite)
sink.writeLength(mutf8Length)
sink.writeFromSequence(characters, startIndex, endIndex)

See the documentation for those methods (linked below) for their limitations, exceptions, parameters, and their meanings.

See also


fun Output.writeMutf8Sequence(characters: CharSequence, range: IntRange = 0..characters.lastIndex, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)(source)

Creates a OutputMutf8Sink around the receiver, writes the mutf8Length of the characters, and then writes the characters themselves.

In code, that would be:

val mutf8Length = characters.mutf8Length(startIndex = range.first, endIndex = range.last + 1)
val sink = OutputMutf8Sink(output = this, bytesPerWrite)
sink.writeLength(mutf8Length)
sink.writeFromSequence(characters, range)

See the documentation for those methods (linked below) for their limitations, exceptions, parameters, and their meanings.

See also