Skip to content

Commit

Permalink
Merge pull request #347 from JohnTitor/note-to-multi-gz-decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor authored May 24, 2023
2 parents aedc7a6 + afbbf48 commit f537522
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/gz/bufread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl<R: BufRead + Write> Write for GzEncoder<R> {
///
/// 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
///
Expand Down Expand Up @@ -401,9 +402,11 @@ impl<R: BufRead + Write> Write for GzDecoder<R> {
/// 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.
Expand Down
8 changes: 5 additions & 3 deletions src/gz/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ impl<R: Read + Write> Write for GzEncoder<R> {
///
/// 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;
Expand Down Expand Up @@ -185,9 +185,11 @@ impl<R: Read + Write> Write for GzDecoder<R> {
/// 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.
Expand Down
1 change: 1 addition & 0 deletions src/gz/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl<W: Write> Drop for GzEncoder<W> {
///
/// 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
///
Expand Down

0 comments on commit f537522

Please sign in to comment.