class CompressionSink
source · line 11public class CompressionSink private constructor(private val stream: SyncCompressionSink) : ByteSink, Closeable
- Supertype
ByteSink - Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A synchronous compression sink adapter with bounded buffering. The ordinary constructor borrows its endpoint; takeOwnership also assumes endpoint close responsibility. Call finish for successful completion; close alone does not finish the format.
function flush
source · line 45public override fun flush(): Unit
- Overrides
flush
Drains a synchronization point and downstream output without ending input.
function close
source · line 55public override fun close(): Unit
- Overrides
close
Releases codec state and closes an endpoint whose ownership was transferred. It does not force incomplete data to finish.
function writeFrom
source · line 41public override 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 count
source · line 41count: Long
parameter buffer
source · line 41buffer: NativeByteBuffer
property totals
source · line 32public val totals: CompressionTotals
get: public read-only
The actual input accepted and output delivered so far.
getter get
source · line 32get(): CompressionTotals
function finish
source · line 50public fun finish(): Unit
Completes the stream and drains final output; decoding also validates that input ended at a complete format boundary.
property failure
source · line 36public val failure: Throwable?
get: public read-only
The retained terminal failure, or None before failure.
getter get
source · line 36get(): Option<Throwable>
constructor constructor
source · line 12constructor(sink: ByteSink, options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions()), bufferSize: Long = 8192L)
parameter options
source · line 12options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions())
parameter sink
source · line 12sink: ByteSink
parameter bufferSize
source · line 13bufferSize: Long = 8192L