Force no compression

Apr 29, 2008 at 4:58 PM
Hi,
Nice library. Thank you.
I was wondering whether there's a way to add a file to the zip with no compression. For example, if I'm adding a bunch of mp3 files, compression might increase file size, but would certainly hurt performance. You mention somewhere that you put in a patch that compares pre- and post- compression sizes. This would address the file size issue, but still would waste clock cycles on compressing a file that's already compressed. I'm wondering about a method like AddFileStream(String Name, String Directory, Stream stream, bool ForceNoCompression). In effect, making your CompressionMethod not be read-only.
Thanks.
Coordinator
May 15, 2008 at 4:04 PM

Hey that sounds like a good suggestion.
I'll add it to the library.

Rather than add another overload to the AddFile() AddItem() AddDirectory() methods, I'm thinking of exposing a property on the ZipFile that dictates whether compression should be used.  The default is YES, but you could set it to NO.

Coordinator
May 31, 2008 at 12:22 AM
I added this. 
It is a property called ForceNoCompression, on the ZipFile class.
It is available, now, in the v1.5 preview release.
Try it out.