08-26-2009 12:35 PM
I'm trying to port file compression code from the Windows Mobile platform using zlib, to the BlackBerry. I have a decompression utility on a third platform that has to be able to handle files from both sources. zlib doesn't have several of the flags that the BlackBerry compression stuff has - there I just call
Taking the same file and compressing it on the BlackBerry, specifying COMPRESSION_BEST (9), all the resulting files are significantly larger than they should be. I've tried every combination I can think of, including the ones I expect must be wrong.
new GZIPOutputStream(os, GZIPOutputStream.COMPRESSION_BEST)
new ZLibOutputStream(os, true, ZLibOutputStream.MAX_LOG2_WINDOW_LENGTH, 9)
new ZLibOutputStream(os, false, ZLibOutputStream.MAX_LOG2_WINDOW_LENGTH, 9)
Will varying the window length change the resulting file? If so, any idea what window length will match zlib's?
Has anyone managed to exchange files between zlib and BlackBerry's compression classes?
* Simulating the Bold
* BlackBerry JDE Component Package 4.5.0