-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend MultiGzDecoder over GzDecoder in docs #324
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7d5856d
Recommend MultiGzDecoder over GzDecoder in docs
jsha 7cfdd4e
minor improvements to the MultiGzDecoder documentation
Byron a232574
applies copies of minor improvements
Byron e21986e
Add top-level comparison between `GzDecoder` and `MultiGzDecoder`
Byron 1e09571
Apply suggestions to impartial to Gz and MultiGz implementations.
Byron 955728b
Tweak the {Gz,MultiGz}Decoder docs more
jsha f0bf8a6
Apply suggestions from code review
Byron fc30d9e
remove introductory paragraph that described other tools unrelated to…
Byron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -90,13 +90,13 @@ impl<R: Read + Write> Write for GzEncoder<R> { | |||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
/// A gzip streaming decoder | ||||||||||||
/// A decoder for a gzip file with a single member. | ||||||||||||
/// | ||||||||||||
/// 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. | ||||||||||||
/// | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html | ||||||||||||
/// This decoder only handles gzipped data with a single stream. | ||||||||||||
/// Use [`MultiGzDecoder`] for gzipped data with multiple streams. | ||||||||||||
/// | ||||||||||||
/// # Examples | ||||||||||||
/// | ||||||||||||
|
@@ -180,21 +180,17 @@ impl<R: Read + Write> Write for GzDecoder<R> { | |||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
/// A gzip streaming decoder that decodes all members of a multistream | ||||||||||||
/// A gzip streaming decoder that decodes a [gzip file] with multiple members. | ||||||||||||
/// | ||||||||||||
/// 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 | ||||||||||||
/// first gzip member. The multistream format is commonly used in 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. | ||||||||||||
/// A gzip file consists of a series of "members" concatenated one after another. | ||||||||||||
/// MultiGzDecoder decodes all members of a file, while [GzDecoder] will only decode | ||||||||||||
/// the first member. Learn more | ||||||||||||
/// [in the introduction](https://docs.rs/flate2/*/flate2/#About-multi-member-Gzip-files). | ||||||||||||
/// | ||||||||||||
/// This structure exposes a [`Read`] interface that will consume all gzip members | ||||||||||||
/// from the underlying reader and emit uncompressed data. | ||||||||||||
/// | ||||||||||||
/// [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html | ||||||||||||
/// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5 | ||||||||||||
/// | ||||||||||||
/// # Examples | ||||||||||||
/// | ||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -166,11 +166,13 @@ impl<W: Write> Drop for GzEncoder<W> { | |||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
/// A gzip streaming decoder | ||||||||||||
/// A decoder for a gzip file with a single member. | ||||||||||||
/// | ||||||||||||
/// This structure exposes a [`Write`] interface that will emit uncompressed data | ||||||||||||
/// to the underlying writer `W`. | ||||||||||||
/// Use [`MultiGzDecoder`] if your file has multiple streams. | ||||||||||||
/// | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
/// This decoder only handles gzipped data with a single stream. | ||||||||||||
/// Use [`MultiGzDecoder`] for gzipped data with multiple streams. | ||||||||||||
Byron marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
/// | ||||||||||||
/// [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html | ||||||||||||
/// | ||||||||||||
|
@@ -373,17 +375,17 @@ impl<W: Read + Write> Read for GzDecoder<W> { | |||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
/// A gzip streaming decoder that decodes all members of a multistream | ||||||||||||
/// A gzip streaming decoder that decodes a [gzip file] with multiple members. | ||||||||||||
/// | ||||||||||||
/// 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 first gzip member. The multistream format is commonly used in | ||||||||||||
/// bioinformatics, for example when using the BGZF compressed data. | ||||||||||||
/// A gzip file consists of a series of "members" concatenated one after another. | ||||||||||||
/// `MultiGzDecoder` decodes all members of a file, while [GzDecoder] will only decode | ||||||||||||
/// the first member. Learn more | ||||||||||||
/// [in the introduction](https://docs.rs/flate2/*/flate2/#About-multi-member-Gzip-files). | ||||||||||||
/// | ||||||||||||
/// This structure exposes a [`Write`] interface that will consume all gzip members | ||||||||||||
/// from the written buffers and write uncompressed data to the writer. | ||||||||||||
/// | ||||||||||||
/// [gzip file]: https://www.rfc-editor.org/rfc/rfc1952#page-5 | ||||||||||||
#[derive(Debug)] | ||||||||||||
pub struct MultiGzDecoder<W: Write> { | ||||||||||||
inner: GzDecoder<W>, | ||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever the final text, it should stick to the RFC terminology of "member" rather than using "stream" in some places.