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

fix(zip): fully implement async deflate #813

Merged
merged 6 commits into from
Dec 16, 2022
Merged

fix(zip): fully implement async deflate #813

merged 6 commits into from
Dec 16, 2022

Conversation

piksel
Copy link
Member

@piksel piksel commented Dec 16, 2022

Using the previously implemented parts of async deflate/ZipOutputStream would only work as long as the compressed size was lower than the internal deflater buffer.
This fix adds async writing to DeflaterOutputStream and GzipOutputStream, and allows ZipOutputStream to empty it's buffer using asynchronous writes.

This also extends the test for ZipOutputStream to try with a larger source buffer and adds a test for GzipOutputStream for wholly-async IO.

Additionally, GzipOutputStream.ModifiedTime can now also be set. This was added to allow the tests to yield a predicable output.

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.

@codecov
Copy link

codecov bot commented Dec 16, 2022

Codecov Report

Merging #813 (20944e4) into master (58b5c4e) will increase coverage by 0.00%.
The diff coverage is 85.36%.

@@           Coverage Diff           @@
##           master     #813   +/-   ##
=======================================
  Coverage   74.77%   74.78%           
=======================================
  Files          72       72           
  Lines        8501     8535   +34     
=======================================
+ Hits         6357     6383   +26     
- Misses       2144     2152    +8     
Impacted Files Coverage Δ
...rc/ICSharpCode.SharpZipLib/GZip/GzipInputStream.cs 71.13% <0.00%> (ø)
src/ICSharpCode.SharpZipLib/Tar/TarBuffer.cs 72.72% <ø> (-0.90%) ⬇️
src/ICSharpCode.SharpZipLib/Tar/TarHeader.cs 84.53% <ø> (+0.05%) ⬆️
src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs 62.32% <ø> (-0.89%) ⬇️
...c/ICSharpCode.SharpZipLib/GZip/GzipOutputStream.cs 86.66% <76.47%> (+0.18%) ⬆️
src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs 88.38% <90.90%> (-0.20%) ⬇️
...ib/Zip/Compression/Streams/DeflaterOutputStream.cs 83.89% <100.00%> (+1.17%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@piksel piksel merged commit 68e2f92 into master Dec 16, 2022
@piksel piksel deleted the fix/deflate-async branch December 16, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant