-
Notifications
You must be signed in to change notification settings - Fork 992
CopyToAsync fails with ZipOutputStream #167
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
Comments
Yes, writing to ZipOutputStream using async does not work and since it is CPU-bound, there should be no real point in doing so. |
I'm not convinced there is no use case for this. CoptyToAsync is part of the API for the base Stream class, and as such should agnostic of the Stream implementation; there is nothing to say that output will be CPU-bound. It could be, but if the ZipOutputStream is backed by a FileStream then in all likelihood it will be IO bound. |
Well, if we were to rewrite it to support async consumer streams it might not be CPU-bound, true. But I closed it because it's a duplicate, not because it's not possible. It would require a bigger rewrite though. |
fwiw, I tried running the sample above with the latest code and didn't see any exceptions - not sure if it's been fixed by other changes or just only happens in some circumstances though? |
Steps to reproduce
An exception occurs when adding a file if using CopyToAsync
I'm using Windows 10 x64.
Expected behavior
The file should be copied without error.
Actual behavior
I get System.NotSupportedException with this message: Size was 0, but I expected y"
Version of SharpZipLib
0.86.0
Obtained from (place an x between the brackets for all that apply)
The text was updated successfully, but these errors were encountered: