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 this platform supports the synchronous compress and decompress functions.
Shared JS/wasmJs compression implementation. Dispatches to Node.js sync APIs or returns browser-unsupported errors.
JVM/Android supports synchronous compression via java.util.zip.
Linux supports synchronous compression via system zlib.
Functions
Compresses data from a ReadBuffer using the specified algorithm. Reads from current position to limit.
JVM/Android implementation delegating to streaming compression.
Linux implementation using system zlib with direct buffer access.
Compresses data using the specified algorithm. Works on all platforms.
Compresses data using Z_SYNC_FLUSH and strips the sync marker.
Creates a suspending streaming decompressor.
Creates a suspending streaming compressor. Required for browser JavaScript which only supports async CompressionStream.
Creates a streaming decompressor.
Creates a streaming compressor.
Linux streaming decompressor factory using z_stream for true incremental decompression.
Linux streaming compressor factory using z_stream for true incremental compression.
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.