writeMutf8Sequence
fun OutputStream.writeMutf8Sequence(characters: CharSequence, startIndex: Int = 0, endIndex: Int = characters.length, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)(source)
Creates a StreamMutf8Sink 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 = StreamMutf8Sink(stream = this, bytesPerWrite)
sink.writeLength(mutf8Length)
sink.writeFromSequence(characters, startIndex, endIndex)
Content copied to clipboard
See the documentation for those methods (linked below) for their limitations, exceptions, parameters, and their meanings.
See also
fun OutputStream.writeMutf8Sequence(characters: CharSequence, range: IntRange = 0..characters.lastIndex, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)(source)
Creates a StreamMutf8Sink 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 = StreamMutf8Sink(stream = this, bytesPerWrite)
sink.writeLength(mutf8Length)
sink.writeFromSequence(characters, range)
Content copied to clipboard
See the documentation for those methods (linked below) for their limitations, exceptions, parameters, and their meanings.