diff --git a/src/gz/bufread.rs b/src/gz/bufread.rs index 8db25605..5b5061a3 100644 --- a/src/gz/bufread.rs +++ b/src/gz/bufread.rs @@ -171,6 +171,7 @@ impl Write for GzEncoder { /// /// This structure consumes a [`BufRead`] interface, reading compressed data /// from the underlying reader, and emitting uncompressed data. +/// Use [`MultiGzDecoder`] if your file has multiple streams. /// /// [`BufRead`]: https://doc.rust-lang.org/std/io/trait.BufRead.html /// @@ -401,9 +402,11 @@ impl Write for GzDecoder { /// A gzip member consists of a header, compressed data and a trailer. The [gzip /// specification](https://tools.ietf.org/html/rfc1952), however, allows multiple /// gzip members to be joined in a single stream. `MultiGzDecoder` will -/// decode all consecutive members while `GzDecoder` will only decompress +/// decode all consecutive members while [`GzDecoder`] will only decompress /// the first gzip member. The multistream format is commonly used in -/// bioinformatics, for example when using the BGZF compressed data. +/// bioinformatics, for example when using the BGZF compressed data. It's also useful +/// to compress large amounts of data in parallel where each thread produces one stream +/// for a chunk of input data. /// /// This structure exposes a [`BufRead`] interface that will consume all gzip members /// from the underlying reader and emit uncompressed data. diff --git a/src/gz/read.rs b/src/gz/read.rs index 2b0796b2..2a16a6ac 100644 --- a/src/gz/read.rs +++ b/src/gz/read.rs @@ -94,13 +94,13 @@ impl Write for GzEncoder { /// /// This structure exposes a [`Read`] interface that will consume compressed /// data from the underlying reader and emit uncompressed data. +/// Use [`MultiGzDecoder`] if your file has multiple streams. /// /// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html /// /// # Examples /// /// ``` -/// /// use std::io::prelude::*; /// use std::io; /// # use flate2::Compression; @@ -185,9 +185,11 @@ impl Write for GzDecoder { /// A gzip member consists of a header, compressed data and a trailer. The [gzip /// specification](https://tools.ietf.org/html/rfc1952), however, allows multiple /// gzip members to be joined in a single stream. `MultiGzDecoder` will -/// decode all consecutive members while `GzDecoder` will only decompress the +/// decode all consecutive members while [`GzDecoder`] will only decompress the /// first gzip member. The multistream format is commonly used in bioinformatics, -/// for example when using the BGZF compressed data. +/// for example when using the BGZF compressed data. It's also useful +/// to compress large amounts of data in parallel where each thread produces one stream +/// for a chunk of input data. /// /// This structure exposes a [`Read`] interface that will consume all gzip members /// from the underlying reader and emit uncompressed data. diff --git a/src/gz/write.rs b/src/gz/write.rs index 5336a17e..dd8a6bd0 100644 --- a/src/gz/write.rs +++ b/src/gz/write.rs @@ -170,6 +170,7 @@ impl Drop for GzEncoder { /// /// This structure exposes a [`Write`] interface that will emit uncompressed data /// to the underlying writer `W`. +/// Use [`MultiGzDecoder`] if your file has multiple streams. /// /// [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html ///