Package okio

Types

ArrayIndexOutOfBoundsException
Link copied to clipboard
class ArrayIndexOutOfBoundsException(message: String?) : IndexOutOfBoundsException
typealias ArrayIndexOutOfBoundsException = ArrayIndexOutOfBoundsException
AsyncTimeout
Link copied to clipboard
open class AsyncTimeout : Timeout
This timeout uses a background thread to take action exactly when the timeout occurs.
Buffer
Link copied to clipboard
common
class Buffer : BufferedSource, BufferedSink
A collection of bytes in memory.
class Buffer : BufferedSource, BufferedSink, Cloneable, ByteChannel
BufferedSink
Link copied to clipboard
common
interface BufferedSink : Sink
A sink that keeps a buffer internally so that callers can do small writes without a performance penalty.
interface BufferedSink : Sink, WritableByteChannel
BufferedSource
Link copied to clipboard
common
interface BufferedSource : Source
A source that keeps a buffer internally so that callers can do small reads without a performance penalty.
interface BufferedSource : Source, ReadableByteChannel
ByteString
Link copied to clipboard
common
open class ByteString : Comparable<ByteString>
An immutable sequence of bytes.
open class ByteString : Serializable, Comparable<ByteString>
CipherSink
Link copied to clipboard
class CipherSink(sink: BufferedSink, cipher: Cipher) : Sink
CipherSource
Link copied to clipboard
class CipherSource(source: BufferedSource, cipher: Cipher) : Source
Closeable
Link copied to clipboard
interface Closeable
typealias Closeable = Closeable
DeflaterSink
Link copied to clipboard
class DeflaterSink : Sink
A sink that uses DEFLATE to compress data written to another source.
EOFException
Link copied to clipboard
open class EOFException(message: String?) : IOException
typealias EOFException = EOFException
ExperimentalFileSystem
Link copied to clipboard
common
annotation class ExperimentalFileSystem
FileHandle
Link copied to clipboard
common
abstract class FileHandle(readWrite: Boolean) : Closeable
An open file for reading and writing; using either streaming and random access.
FileMetadata
Link copied to clipboard
common
class FileMetadata(isRegularFile: Boolean, isDirectory: Boolean, size: Long?, createdAtMillis: Long?, lastModifiedAtMillis: Long?, lastAccessedAtMillis: Long?)
Description of a file or another object referenced by a path.
FileNotFoundException
Link copied to clipboard
class FileNotFoundException(message: String?) : IOException
typealias FileNotFoundException = FileNotFoundException
FileSystem
Link copied to clipboard
common
abstract class FileSystem
Read and write access to a hierarchical collection of files, addressed by paths.
abstract class FileSystem
abstract class FileSystem
ForwardingFileSystem
Link copied to clipboard
common
abstract class ForwardingFileSystem(delegate: FileSystem) : FileSystem
A FileSystem that forwards calls to another, intended for subclassing.
ForwardingSink
Link copied to clipboard
abstract class ForwardingSink(delegate: Sink) : Sink
A Sink which forwards calls to another.
ForwardingSource
Link copied to clipboard
abstract class ForwardingSource(delegate: Source) : Source
A Source which forwards calls to another.
ForwardingTimeout
Link copied to clipboard
open class ForwardingTimeout(delegate: Timeout) : Timeout
A Timeout which forwards calls to another.
GzipSink
Link copied to clipboard
class GzipSink(sink: Sink) : Sink
A sink that uses GZIP to compress written data to another sink.
GzipSource
Link copied to clipboard
class GzipSource(source: Source) : Source
A source that uses GZIP to decompress data read from another source.
HashingSink
Link copied to clipboard
common
class HashingSink : Sink
A sink that computes a hash of the full stream of bytes it has accepted.
class HashingSink : ForwardingSink, Sink
A sink that computes a hash of the full stream of bytes it has accepted.
HashingSource
Link copied to clipboard
common
class HashingSource : Source
A source that computes a hash of the full stream of bytes it has supplied.
class HashingSource : ForwardingSource, Source
A source that computes a hash of the full stream of bytes it has supplied.
InflaterSource
Link copied to clipboard
class InflaterSource : Source
A source that uses DEFLATE to decompress data read from another source.
IOException
Link copied to clipboard
open class IOException(message: String?, cause: Throwable?) : Exception
typealias IOException = IOException
Options
Link copied to clipboard
common
class Options : AbstractList<ByteString> , RandomAccess
An indexed set of values that may be read with BufferedSource.select.
Path
Link copied to clipboard
common
class Path : Comparable<Path>
A hierarchical address on a file system.
class Path : Comparable<Path>
Pipe
Link copied to clipboard
class Pipe(maxBufferSize: Long)
A source and a sink that are attached.
Sink
Link copied to clipboard
common
interface Sink : Closeable
Receives a stream of bytes.
interface Sink : Closeable, Flushable
Source
Link copied to clipboard
common
interface Source : Closeable
Supplies a stream of bytes.
Throttler
Link copied to clipboard
class Throttler
Enables limiting of Source and Sink throughput.
Timeout
Link copied to clipboard
common
open class Timeout
A policy on how much time to spend on a task before giving up.
open class Timeout
ZipFileSystem
Link copied to clipboard
class ZipFileSystem : FileSystem
Read only access to a zip file and common extra fields.

Functions

appendingSink
Link copied to clipboard
fun File.appendingSink(): Sink
Returns a sink that writes to file.
asResourceFileSystem
Link copied to clipboard
fun ClassLoader.asResourceFileSystem(): FileSystem
blackholeSink
Link copied to clipboard
common
@JvmName(name = "blackhole")
fun blackholeSink(): Sink
Returns a sink that writes nowhere.
buffer
Link copied to clipboard
common
fun Sink.buffer(): BufferedSink
Returns a new sink that buffers writes to sink.
fun Source.buffer(): BufferedSource
Returns a new source that buffers reads from source.
cipherSink
Link copied to clipboard
fun Sink.cipherSink(cipher: Cipher): CipherSink
Returns a sink that uses cipher to encrypt or decrypt this.
cipherSource
Link copied to clipboard
fun Source.cipherSource(cipher: Cipher): CipherSource
Returns a source that uses cipher to encrypt or decrypt this.
deflate
Link copied to clipboard
inline fun Sink.deflate(deflater: Deflater = Deflater()): DeflaterSink
Returns an DeflaterSink that DEFLATE-compresses data to this Sink while writing.
gzip
Link copied to clipboard
inline fun Sink.gzip(): GzipSink
Returns a GzipSink that gzip-compresses to this Sink while writing.
inline fun Source.gzip(): GzipSource
Returns a GzipSource that gzip-decompresses this Source while reading.
hashingSink
Link copied to clipboard
fun Sink.hashingSink(digest: MessageDigest): HashingSink
Returns a sink that uses digest to hash this.
fun Sink.hashingSink(mac: Mac): HashingSink
Returns a sink that uses mac to hash this.
hashingSource
Link copied to clipboard
fun Source.hashingSource(digest: MessageDigest): HashingSource
Returns a source that uses digest to hash this.
fun Source.hashingSource(mac: Mac): HashingSource
Returns a source that uses mac to hash this.
inflate
Link copied to clipboard
inline fun Source.inflate(inflater: Inflater = Inflater()): InflaterSource
Returns an InflaterSource that DEFLATE-decompresses this Source while reading.
openZip
Link copied to clipboard
fun FileSystem.openZip(zipPath: Path): FileSystem
sink
Link copied to clipboard
fun OutputStream.sink(): Sink
Returns a sink that writes to out.
fun Socket.sink(): Sink
Returns a sink that writes to socket.
fun File.sink(append: Boolean = false): Sink
Returns a sink that writes to file.
@IgnoreJRERequirement()
fun Path.sink(vararg options: OpenOption): Sink
Returns a source that reads from path.
source
Link copied to clipboard
fun File.source(): Source
Returns a source that reads from file.
fun InputStream.source(): Source
Returns a source that reads from in.
fun Socket.source(): Source
Returns a source that reads from socket.
@IgnoreJRERequirement()
fun Path.source(vararg options: OpenOption): Source
Returns a sink that writes to path.
toByteString
Link copied to clipboard
apple
fun <ERROR CLASS>.toByteString(): <ERROR CLASS>
use
Link copied to clipboard
common
inline fun <T : Closeable?, R> T.use(block: (T) -> R): R
Execute block then close this.
utf8Size
Link copied to clipboard
common
@JvmName(name = "size")
fun String.utf8Size(beginIndex: Int = 0, endIndex: Int = length): Long
Returns the number of bytes used to encode the slice of string as UTF-8 when using BufferedSink.writeUtf8.

Properties

Okio
Link copied to clipboard
val Okio: -DeprecatedOkio
Utf8
Link copied to clipboard
val Utf8: -DeprecatedUtf8