class CompressionEncoder
source · line 9public class CompressionEncoder public constructor(
options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions())
) : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A stateful incremental encoder using caller-owned input and output buffers. Drain flush/finish until their operation completes; close releases native state without completing a stream.
function flush
source · line 36public fun flush(output: NativeByteBuffer): CompressionStep
Produces a format synchronization point without ending input; drain output before resuming input.
parameter output
source · line 36output: NativeByteBuffer
function process
source · line 30public fun process(input: NativeByteBuffer, output: NativeByteBuffer, count: Long = input.readableBytes): CompressionStep
Consumes at most count readable input bytes and appends encoded bytes to output, advancing both cursors by the returned counts.
parameter input
source · line 30input: NativeByteBuffer
parameter output
source · line 30output: NativeByteBuffer
parameter count
source · line 30count: Long = input.readableBytes
function finish
source · line 40public fun finish(output: NativeByteBuffer): CompressionStep
Ends input and drains final format bytes. Continue with output space until Finished.
parameter output
source · line 40output: NativeByteBuffer
property format
source · line 16public val format: CompressionFormat
get: public read-only
The explicitly selected compressed wire format.
getter get
source · line 16get(): CompressionFormat
constructor constructor
source · line 9constructor(options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions()))
parameter options
source · line 10options: CompressionOptions = CompressionOptions.Zstd(ZstdOptions())
function close
source · line 44public override fun close(): Unit
- Overrides
close
Releases native codec state. Closing does not finish incomplete stream or message data.
property totals
source · line 20public val totals: CompressionTotals
get: public read-only
The actual cumulative byte counts accepted and produced by this codec.
getter get
source · line 20get(): CompressionTotals
property failure
source · line 24public val failure: Throwable?
get: public read-only
The recorded terminal failure, or None before failure.
getter get
source · line 24get(): Option<Throwable>