Package-level declarations
Types
Strategy for allocating buffers during compression/decompression. Allows control over memory allocation to optimize for different use cases.
Compression algorithm types.
Exception thrown when compression/decompression fails.
Compression level.
Result of compression/decompression operations.
Deflate format constants.
Stateful streaming compressor that processes data incrementally. Useful for compressing data that arrives in chunks (e.g., from network).
Stateful streaming decompressor that processes data incrementally.
Suspending streaming compressor for async-only platforms. Browser JavaScript requires this variant since CompressionStream is async.
Suspending streaming decompressor for async-only platforms.
Properties
Whether the current platform supports raw deflate (no zlib/gzip headers).
Whether the sync StreamingCompressor maintains compression state across flush() calls.
Whether the sync StreamingCompressor maintains dictionary across flush() calls.
Apple supports synchronous compression via system zlib.
Whether this platform supports the synchronous compress and decompress functions.
JS supports synchronous compression only in Node.js via native zlib module. Browser only has async CompressionStream API - use SuspendingStreamingCompressor instead.
JVM/Android supports synchronous compression via java.util.zip.
Functions
Apple implementation using system zlib with direct buffer access.
Compresses data from a ReadBuffer using the specified algorithm. Reads from current position to limit.
JS implementation using native Node.js zlib. Browser throws UnsupportedOperationException - use streaming API instead.
JVM/Android implementation delegating to streaming compression.
Compresses data using the specified algorithm. Works on all platforms.
Compresses data using Z_SYNC_FLUSH and strips the sync marker.
Apple streaming compressor factory using z_stream for true incremental compression.
Apple streaming decompressor factory using z_stream for true incremental decompression.
Creates a suspending streaming decompressor.
Creates a suspending streaming compressor. Required for browser JavaScript which only supports async CompressionStream.
Creates a streaming compressor.
Creates a streaming decompressor.
JS suspending streaming decompressor factory. Node.js: uses Transform stream API for stateful decompression. Browser: uses native DecompressionStream API.
JS suspending streaming compressor factory. Node.js: uses Transform stream API for stateful compression with flush support. Browser: uses native CompressionStream API (no flush support).
JS streaming compressor factory. Node.js: uses native zlib sync APIs. Browser: throws UnsupportedOperationException (use SuspendingStreamingCompressor instead).
JS streaming decompressor factory. Node.js: uses native zlib sync APIs. Browser: throws UnsupportedOperationException (use SuspendingStreamingDecompressor instead).
Decompresses data from a ReadBuffer using the specified algorithm. Reads from current position to limit.
Adds decompression to the StreamProcessor pipeline.
Decompresses data using the specified algorithm. Works on all platforms.
Decompresses data that was compressed with compressWithSyncFlush.
Extension function to get buffer from CompressionResult, returning null on failure.
Extension function to get buffer from CompressionResult, throwing on failure.
Strips the Z_SYNC_FLUSH marker (00 00 FF FF) from the end of compressed data.
Convenience function that handles compress, finish, and close automatically. Returns all output chunks (from both compress and finish calls).
Convenience function that handles decompress, finish, and close automatically.
Convenience function that handles compress, finish, and close automatically. All output chunks (from both compress and finish) go to the same callback.
Suspending version of use for use with suspending I/O. Uses the efficient synchronous compressor but allows suspend calls in the block.
Suspending version of use for use with suspending I/O.