create

expect fun StreamingCompressor.Companion.create(algorithm: CompressionAlgorithm = CompressionAlgorithm.Deflate, level: CompressionLevel = CompressionLevel.Default, allocator: BufferAllocator = BufferAllocator.Default, outputBufferSize: Int = 32768, windowBits: Int = 0): StreamingCompressor

Creates a streaming compressor.

Parameters

algorithm

The compression algorithm to use.

level

The compression level.

allocator

Strategy for allocating output buffers.

outputBufferSize

Size of output buffers (default 32KB).

windowBits

The zlib window size (log2 of the LZ77 window size). When 0 (the default), uses the algorithm's default: 15 for Deflate/Zlib, -15 for Raw, 31 for Gzip. When non-zero, the value is passed directly to deflateInit2(). Valid range depends on the algorithm. Note: JVM's java.util.zip.Deflater does not support custom window sizes; this parameter is ignored on JVM.


expect fun StreamingDecompressor.Companion.create(algorithm: CompressionAlgorithm = CompressionAlgorithm.Deflate, allocator: BufferAllocator = BufferAllocator.Default, outputBufferSize: Int = 32768, expectedSize: Int = 0): StreamingDecompressor

Creates a streaming decompressor.

Parameters

algorithm

The compression algorithm to use.

allocator

Strategy for allocating output buffers.

outputBufferSize

Size of output buffers (default 32KB).

expectedSize

Optional hint for expected decompressed size. Used to pre-allocate buffers.


expect fun SuspendingStreamingCompressor.Companion.create(algorithm: CompressionAlgorithm = CompressionAlgorithm.Deflate, level: CompressionLevel = CompressionLevel.Default, allocator: BufferAllocator = BufferAllocator.Default): SuspendingStreamingCompressor

Creates a suspending streaming compressor. Required for browser JavaScript which only supports async CompressionStream.


expect fun SuspendingStreamingDecompressor.Companion.create(algorithm: CompressionAlgorithm = CompressionAlgorithm.Deflate, allocator: BufferAllocator = BufferAllocator.Default): SuspendingStreamingDecompressor

Creates a suspending streaming decompressor.

actual fun StreamingCompressor.Companion.create(algorithm: CompressionAlgorithm, level: CompressionLevel, allocator: BufferAllocator, outputBufferSize: Int, windowBits: Int): StreamingCompressor

Linux streaming compressor factory using z_stream for true incremental compression.


actual fun StreamingDecompressor.Companion.create(algorithm: CompressionAlgorithm, allocator: BufferAllocator, outputBufferSize: Int, expectedSize: Int): StreamingDecompressor

Linux streaming decompressor factory using z_stream for true incremental decompression.


actual fun SuspendingStreamingCompressor.Companion.create(algorithm: CompressionAlgorithm, level: CompressionLevel, allocator: BufferAllocator): SuspendingStreamingCompressor
actual fun SuspendingStreamingDecompressor.Companion.create(algorithm: CompressionAlgorithm, allocator: BufferAllocator): SuspendingStreamingDecompressor