Package-level declarations

Utilities for Modified UTF-8 I/O with ktor-io's Input and Output classes.

Types

Link copied to clipboard
class InputMutf8Source(input: Input) : Mutf8Source

A Mutf8Source that reads its data from an Input from the ktor library.

Link copied to clipboard
class OutputMutf8Sink(output: Output, bytesPerWrite: Int = 1024) : Mutf8Sink

A Mutf8Sink that writes its data to an Output from the ktor library.

Functions

Link copied to clipboard
@JvmName(name = "readArrayFrom")
fun Input.readMutf8Array(): CharArray

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

Link copied to clipboard
@JvmName(name = "readStringFrom")
fun Input.readMutf8String(): String

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

Link copied to clipboard
@JvmName(name = "readToAppendableFrom")
fun Input.readMutf8ToAppendable(destination: Appendable)

Creates a InputMutf8Source 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.

Link copied to clipboard
fun Output.writeMutf8Array(characters: CharArray, range: IntRange = 0..characters.lastIndex, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)
@JvmName(name = "writeArrayTo")
fun Output.writeMutf8Array(characters: CharArray, startIndex: Int = 0, endIndex: Int = characters.size, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)

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

Link copied to clipboard
fun Output.writeMutf8Sequence(characters: CharSequence, range: IntRange = 0..characters.lastIndex, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)
@JvmName(name = "writeSequenceTo")
fun Output.writeMutf8Sequence(characters: CharSequence, startIndex: Int = 0, endIndex: Int = characters.length, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)

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