rust-lang / flate2-rs

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

Document that `read::GzDecoder` consumes bytes after end of gzip #367

Closed jongiddy closed 11 months ago

jongiddy commented 11 months ago

Add tests showing that the GzDecoders in bufread and write support reading immediately after end of gzip data.

read::GzDecoder can read past the end of gzip data, and a subsequent read of the inner type loses those bytes.

jongiddy commented 11 months ago

I added a note to the read module describing the behaviour of read decoders and how to get the typically expected behaviour.