Skip to content
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

Skip forced Deflate flush when using Stored compression #406

Merged
merged 2 commits into from
Jan 27, 2020

Conversation

piksel
Copy link
Member

@piksel piksel commented Dec 30, 2019

Since #225 added forced flushing to DeflaterOutputStream it will run the deflate state machine even if it's not supposed to be used. This did not happen before since it were always in a state where it did not need more data when using CompressionMethod.Stored.

By overriding the Flush() method in ZipOutputStream we can skip the forced deflate flush when it isn't used.

Should fix #398 and #391

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@piksel piksel added bug zip Related to ZIP file format ready PR ready for merging when appropriate labels Dec 30, 2019
@piksel piksel merged commit 20c10a5 into master Jan 27, 2020
@piksel piksel deleted the zip-store-flush branch January 27, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready PR ready for merging when appropriate zip Related to ZIP file format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CompressionMethod.Stored defective in V 1.2.0 (compared to 1.1.0)
1 participant