StreamingDecompressor

Stateful streaming decompressor that processes data incrementally.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val bufferFactory: BufferFactory

The buffer factory used by this decompressor.

Functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract fun decompress(input: ReadBuffer, onOutput: (ReadBuffer) -> Unit)

Decompresses input data, invoking the callback for each output chunk.

Link copied to clipboard
abstract fun finish(onOutput: (ReadBuffer) -> Unit)

Finishes decompression, validating completeness.

Link copied to clipboard
open fun flush(onOutput: (ReadBuffer) -> Unit)

Emits any buffered partial output without finalizing the stream.

Link copied to clipboard
abstract fun reset()

Resets the decompressor to initial state for reuse.

Link copied to clipboard
inline fun <R> StreamingDecompressor.use(noinline onOutput: (ReadBuffer) -> Unit, block: (decompress: (ReadBuffer) -> Unit) -> R): R

Convenience function that handles decompress, finish, and close automatically.

Link copied to clipboard
inline suspend fun <R> StreamingDecompressor.useSuspending(noinline onOutput: (ReadBuffer) -> Unit, block: suspend (decompress: (ReadBuffer) -> Unit) -> R): R

Suspending version of use for use with suspending I/O.