ForwardingSource

expect abstract class ForwardingSource(delegate: Source) : Source

A Source which forwards calls to another. Useful for subclassing.

actual abstract class ForwardingSource(val delegate: Source) : Source

Inheritors

actual abstract class ForwardingSource(val delegate: Source) : Source

Constructors

Link copied to clipboard
expect constructor(delegate: Source)
actual constructor(delegate: Source)
actual constructor(delegate: Source)

Properties

Link copied to clipboard
expect val delegate: Source

Source to which this instance is delegating.

@get:JvmName(name = "delegate")
actual val delegate: Source
actual val delegate: Source

Functions

Link copied to clipboard

Returns a new source that buffers reads from source. The returned source will perform bulk reads into its in-memory buffer. Use this wherever you read a source to get an ergonomic and efficient access to data.

Link copied to clipboard

Returns a source that uses cipher to encrypt or decrypt this.

Link copied to clipboard
expect open override fun close()

Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.

actual open override fun close()

Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.

actual open override fun close()

Closes this source and releases the resources held by this source. It is an error to read a closed source. It is safe to close a source more than once.

Link copied to clipboard
inline fun Source.gzip(): GzipSource

Returns a GzipSource that gzip-decompresses this Source while reading.

Link copied to clipboard

Returns a source that uses digest to hash this.

Returns a source that uses mac to hash this.

Link copied to clipboard
inline fun Source.inflate(inflater: Inflater = Inflater()): InflaterSource

Returns an InflaterSource that DEFLATE-decompresses this Source while reading.

Link copied to clipboard
expect open override fun read(sink: Buffer, byteCount: Long): Long

Removes at least 1, and up to byteCount bytes from this and appends them to sink. Returns the number of bytes read, or -1 if this source is exhausted.

actual open override fun read(sink: Buffer, byteCount: Long): Long

Removes at least 1, and up to byteCount bytes from this and appends them to sink. Returns the number of bytes read, or -1 if this source is exhausted.

actual open override fun read(sink: Buffer, byteCount: Long): Long

Removes at least 1, and up to byteCount bytes from this and appends them to sink. Returns the number of bytes read, or -1 if this source is exhausted.

Link copied to clipboard
expect open override fun timeout(): Timeout

Returns the timeout for this source.

actual open override fun timeout(): Timeout

Returns the timeout for this source.

actual open override fun timeout(): Timeout

Returns the timeout for this source.

Link copied to clipboard
expect open override fun toString(): String
actual open override fun toString(): String
actual open override fun toString(): String