Package-level declarations

Utilities for Modified UTF-8 I/O with okio's Source and Sink classes. Their more frequently used subclasses, BufferedSource, BufferedSink and Buffer, are also supported.

Types

Link copied to clipboard
class OkioMutf8Sink(sink: Sink, bytesPerWrite: Int = 1024) : Mutf8Sink

A Mutf8Sink that writes its data to a Sink from the okio library.

Link copied to clipboard
class OkioMutf8Source(source: Source) : Mutf8Source

A Mutf8Source that reads its data from a Source from the okio library.

Functions

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

Creates a OkioMutf8Source 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 Source.readMutf8String(): String

Creates a OkioMutf8Source 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 Source.readMutf8ToAppendable(destination: Appendable)

Creates a OkioMutf8Source 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 Sink.writeMutf8Array(characters: CharArray, range: IntRange = 0..characters.lastIndex, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)
@JvmName(name = "writeArrayTo")
fun Sink.writeMutf8Array(characters: CharArray, startIndex: Int = 0, endIndex: Int = characters.size, bytesPerWrite: Int = DEFAULT_BYTES_PER_WRITE)

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

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

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