0

I am looking for a list of possible ways to compress files on Windows Mobile platform using C++/C#. I'd like to see all possible ways this can be achieved, including links to sample projects if at all possible. I'd like to see all possibilities, no matter the performance hits. As a reference, say I need to zip 300 MB of data.

  • A quick google turns up this Class http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx Any Good? – Joel Jan 19 '12 at 15:37
  • 1
    The GZipStream and DeflateStream classes can _significantly_ increase the size of “compressed” data. That means, they don’t just add a few header bytes as stand-alone compressors do, but they _inflate_ the data by as much as 50%. This is apparently because these classes do not check for incompressible data which is a standard feature of all stand-alone compressors. Both classes work fine when the data actually can be compressed. Please refer to this thread for more details: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=179704&SiteID=1 – Peter Arandorenko Jan 19 '12 at 15:50
  • Oh right, Thanks for that guess that's something to be aware of – Joel Jan 19 '12 at 15:53

2 Answers2

0

"I'd like to see all possibilities" -- we are probably not going to list all possibilities, as there are way too lot of them.

But here are a few samples using C (so can be used from C++):

libzip for zipping files: http://www.nih.at/libzip/

libarchive for handling various formats of archives, for example, zip, tar, xar, ... http://people.freebsd.org/~kientzle/libarchive/

lzma SDK, probably the better compression rate, and very slow: http://7-zip.org/sdk.html

zlib, the most portable ZIP compression/decompression library ever: http://zlib.net/

This also is for zip: http://zziplib.sourceforge.net/

Hope that'll be sufficient.

  • ZLIB is not a ZIP compression/decompression library. It's a portable deflate algorithm implementation with couple of extras such GZIP compressor etc. ZIP is container format while deflate is a compression algorithm (or more precisely lossless data codec). – Osman Turan Jan 19 '12 at 22:10
  • Thanks for clarifying. I've just seen that ZIP uses it and thought it was the relation. –  Jan 20 '12 at 06:11
0

Windows Mobile tends to translate into : low-energy platforms. In this case, you may be interested into fast low-energy compression libraries, that will finish their job 10x faster than zip. This directly translates into longer battery life.

For C++ , you may try Snappy.

For C, C++ and C#, you may try LZ4.

If you don't mind a viral GPL license, you may also try LZO.

Cyan
  • 13,248
  • 8
  • 43
  • 78