SdkSinkObserver

abstract class SdkSinkObserver(delegate: SdkSink) : SdkSink

Base class for implementing more advanced behavior (e.g. hashing sink)

Inheritors

Constructors

Link copied to clipboard
constructor(delegate: SdkSink)

Functions

Link copied to clipboard
abstract fun observe(data: ByteArray, offset: Int, length: Int)

Callback function invoked with access to the raw data being written. Only data in the range [offset, offset+length) is valid! Do not go out of bounds or mutate the data!

Link copied to clipboard
open override fun write(source: SdkBuffer, byteCount: Long)

Removes byteCount bytes from source and appends them to this.

Inherited functions

Link copied to clipboard

Returns a new sink that buffers writes to the sink. Writes will be efficiently "batched". Call SdkSink.flush when done to emit all data to the underlying sink.

Link copied to clipboard
open override fun close()

Pushes all buffered bytes to their final destination and releases resources held by this sink. It is an error to write to a closed sink. This is an idempotent operation.

Link copied to clipboard
open override fun flush()

Pushes all buffered bytes to their final destination

Link copied to clipboard
fun SdkSink.toOkio(): <Error class: unknown class>