autocompress-rs
Automatically select suitable decoder from magic bytes or encoder from file extension. This library also provides I/O thread pool to perform decompression and compression in background threads.
Supported file formats
- Gzip
- Zlib (Cannot suggest format from magic bytes and file extension)
- BZip2
- XZ
- Z-standard
Feature flags
gzip
: Gzip format supportbgzip
: bgzip format supportbzip2
: Bzip2 format supportxz
: XZ format supportzstd
: Zstd format supportrayon
: Off-load compression and decompression process to another thread using rayontokio
: Async reader and writer support with tokiotokio_fs
: Enableautodetect_async_open
function
Example
Read from a file
use *;
use autodetect_open;
Write to a file
use *;
use ;
Compress file in parallel
use *;
use ;