#bzip #api-bindings

bzip2

Bindings to libbzip2 for bzip2 compression and decompression exposed as Reader/Writer streams

25 releases

0.6.1 Oct 16, 2025
0.6.0 Jun 17, 2025
0.5.2 Feb 28, 2025
0.5.0 Dec 11, 2024
0.0.3 Nov 19, 2014

#21 in Compression

Download history 1904319/week @ 2026-01-21 1795006/week @ 2026-01-28 1755228/week @ 2026-02-04 1647152/week @ 2026-02-11 1831144/week @ 2026-02-18 2041682/week @ 2026-02-25 2386778/week @ 2026-03-04 2406033/week @ 2026-03-11 1793376/week @ 2026-03-18 1648714/week @ 2026-03-25 1697277/week @ 2026-04-01 1834904/week @ 2026-04-08 1759131/week @ 2026-04-15 1768777/week @ 2026-04-22 1813364/week @ 2026-04-29 1912220/week @ 2026-05-06

7,589,565 downloads per month
Used in 4,165 crates (416 directly)

MIT/Apache

210KB
2.5K SLoC

C 1.5K SLoC // 0.2% comments Rust 1K SLoC // 0.0% comments XSL 69 SLoC // 0.1% comments Shell 18 SLoC // 0.2% comments Perl 9 SLoC // 0.4% comments

bzip2

Documentation

A streaming bzip2 compression/decompression library for rust.

Features

bzip2-sys

Attempt to use the system libbz2. When libbz2 is not available, built from source. A from-source build requires a functional C toolchain for your target, and may not work for all targets (in particular webassembly).

bzip2 = { version = "0.5.1", default-features = false, features = ["bzip2-sys"] }

static

Always build libbz2 from C source, and statically link it. This flag is only meaningful when bzip2-sys is used, and has no effect when the default libbz2-rs-sys is used as the bzip2 implementation.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repository by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies