rust-lang / flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
https://docs.rs/flate2
Apache License 2.0
891 stars 158 forks source link

How to decompress files? #275

Closed 834772509 closed 3 years ago

834772509 commented 3 years ago

I found examples of compressed files in the examples, but no examples of decompressed files. I've tried to write code for decompressing files, but the prompt is "error: decompresserror (decompresserrorinner {needs}_ Dictionary: none})} ", can you provide an example of decompressing a file?

alexcrichton commented 3 years ago

Decompression uses the "decoder" family of types, and their usage should be included in the examples of this repository (all the usage is very similar).

If you're getting an error you may not be using the right type of decoder or you might be using a different format this crate doesn't support.