class AsyncCompressionSink
source · line 13public class AsyncCompressionSink private constructor(private val stream: AsyncCompressionSinkImpl) : AsyncByteSink, AsyncCloseable
- Supertype
AsyncByteSink - Supertype
AsyncCloseable
A suspending compression sink adapter with bounded buffering. The ordinary constructor borrows its endpoint; takeOwnership also assumes endpoint close responsibility. I/O waits suspend; codec computation remains local. Cancellation cleanup waits for active operations. Call finish for successful completion; close alone does not finish the format.
property totals
source · line 34public val totals: CompressionTotals
get: public read-only
The actual input accepted and output delivered so far.
getter get
source · line 34get(): CompressionTotals
function flush
source · line 47public override suspend fun flush(): Unit
- Overrides
flush
Drains a synchronization point and downstream output without ending input.
constructor constructor
source · line 14constructor(sink: AsyncByteSink, options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions()), bufferSize: Long = 8192L)
parameter options
source · line 14options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions())
parameter bufferSize
source · line 15bufferSize: Long = 8192L
parameter sink
source · line 14sink: AsyncByteSink
function finish
source · line 52public suspend fun finish(): Unit
Completes the stream and drains final output; decoding also validates that input ended at a complete format boundary.
function writeFrom
source · line 43public override suspend fun writeFrom(buffer: NativeByteBuffer, count: Long): Long
- Overrides
writeFrom
Consumes up to count readable bytes from the input buffer while passing transformed output downstream.
parameter buffer
source · line 43buffer: NativeByteBuffer
parameter count
source · line 43count: Long
function close
source · line 57public override suspend fun close(): Unit
- Overrides
close
Releases codec state and closes an endpoint whose ownership was transferred. It does not force incomplete data to finish.
property failure
source · line 38public val failure: Throwable?
get: public read-only
The retained terminal failure, or None before failure.
getter get
source · line 38get(): Option<Throwable>