编辑:现在有flate2、libflate和deflate。
所以我结合了dbaupp和Mark Adler的建议,创建了一个gzip解压缩器:https://github.com/alexcrichton/rust-compress/pull/30
然而,事实证明Crichton先生已经写了一个gzip层:https://github.com/alexcrichton/flate2-rs
目前,存在这两个选项;尚不清楚哪种会成为标准的Rust解决方案。
flate生成并处理原始的和zlib-wrapped压缩流。 gzip流(即gunzip、zcat等的工作流)是一个gzip-wrapped的压缩流。如果您想使用flate,那么您需要先处理gzip头,然后使用flate解压缩数据,最后处理gzip尾。gzip头和尾在RFC 1952中有记录。