views:

44

answers:

2

I'm looking into compressing binary data, more specifically serialized Java objects. I think I need an implementation of one of the algorithms that are listed on this Wikipedia page. I found a couple of tutorials and blog posts but no libraries (and most code I found seemed to be ported from other languages... and I don't trust the efficiency and accuracy of a Java library where method names begin with capital letters). So, any pointers on which algorithm is most suitable for compressing serialized Java objects (as well as arbitrary binary data) would be much appreciated. And it would be amazing if someone knows of an active project that relates to this topic (Apache didn't seem to have anything).

A: 

You could take a look at [G]Zip(In|Out)putStream for a fully-after-serialization compression scheme. It might give you good compression without having to change any of your existing serialization logic. You'd have to test it to determine the difference it would make.

Mark Peters
I tried out [java.util.zip.Deflater](http://java.sun.com/javase/6/docs/api/java/util/zip/Deflater.html) and that didn't yield good compression
Andrey
+2  A: 

Actually JBoss provides good alternative to standard java serialization mechanism - JBoss Serialization. Have a look at http://jboss.org/serialization

uthark