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.
I have a
tar
-file that contains anothertar.gz
-file that I want do extract using SharpCompress.When I am iterating through the outer
tar
-file, and find thetar.gz
-file I want to extract, I use a CryptoStream that calculates the SHA256-sum of thetar.gz
-entry while I extract it (using the IReader extension WriteAllToDirectory)This seems to work without issues, but somtimes (due to CryptoStreams internal implementation), the
tar.gz
EntryStream will throw aNotSupportedException
when the CryptoStream is being Disposed, because it will sometimes callFlush()
on the EntryStream (see here).From what I can see there is no reason to not allow flushing the EntryStream, as there is nothing to flush. Microsoft also mentions in the Stream.Flush-documentation that read-only streams should implement Flush with an empty method.
This pull request fixes that, and also adds a test that "provokes" this issue (not sure if that is needed or wanted)