CompressionInfo on AddFile does not work #82

Closed
opened 2026-01-29 22:06:16 +00:00 by claunia · 3 comments
Owner

Originally created by @kenkendk on GitHub (Jan 25, 2016).

When calling WriteToStream and supplying a CompressionInfo instance, it appears to be ignored.
Instead, the implementation reads the CompressionInfo instance passed to the constructor for the ZipWriter. By hacking it with reflection, I can change the CompressionLevel field on the original instance, and that allows me to change the compression level on a per-stream basis.

Originally created by @kenkendk on GitHub (Jan 25, 2016). When calling `WriteToStream` and supplying a `CompressionInfo` instance, it appears to be ignored. Instead, the implementation reads the `CompressionInfo` instance passed to the constructor for the `ZipWriter`. By hacking it with reflection, I can change the `CompressionLevel` field on the original instance, and that allows me to change the compression level on a per-stream basis.
Author
Owner

@adamhathcock commented on GitHub (Feb 3, 2016):

Any chance for a PR? I'll queue this up to look at.

@adamhathcock commented on GitHub (Feb 3, 2016): Any chance for a PR? I'll queue this up to look at.
Author
Owner

@kenkendk commented on GitHub (Feb 4, 2016):

Yes, there is now a PR.

There should also be a unittest for this, but I have not made that.

@kenkendk commented on GitHub (Feb 4, 2016): Yes, there is now a PR. There should also be a unittest for this, but I have not made that.
Author
Owner

@adamhathcock commented on GitHub (Feb 4, 2016):

Thanks! I'll test it later.

@adamhathcock commented on GitHub (Feb 4, 2016): Thanks! I'll test it later.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#82