views:

20

answers:

1

Is there some library or built-in funcionality in J2ME to compress a byte array trough ZIP?

I'd like to do something like this:

byte[] data; byte[] compressed = ZIPLibrary.compress(data);

Thanks.

A: 

Zip is an archive format as well as a compressor, meaning that it takes sets of files as input rather than a byte string. Use has the Deflater class instead; it implements the "deflate" algorithm that (I believe) is also used in Zip. Decompression can be done using Inflater.

larsmans
I don't think that author develop for CDC. CLDC and MIDP don't contain built-in classes for operating with ZIP. So he need to port this classes to MIDP
Donz
I found a J2me library with Zip utilities for CLDC and MIDP: http://www.j2mepolish.org/javadoc/j2me/de/enough/polish/util/zip/package-summary.html
Eduardo Abreu