What is a good compression library for Java?

I need to compress some of our network application traffic to improve performance. I guess this means that I need to stay away from some new algorithms like bzip2, which I think I heard more slowly.

+5
source share
3 answers

You can use Deflater / Inflater , which is built into the JDK. There are also GZIPInputStream and GZIPOutputStream, but it really depends on your exact use.

Edit:

, , - HTTP. , , ( deflate/gzip). . , , , . webservices http client, , , .

, jakarta-commons httpclient , . , -

.addRequestHeader("Accept-Encoding","gzip,deflate");
+11

HTTP, -/ zip-, mod_deflate Apache.

+1

, , , .

gigibit, . WAN , . dialup, , .

WAN, , "Riverbed" , , - .

I have a test case that shows the relative compression difference between Deflate, Filtered, BZip2 and lzma . Just plug in the sample data and check the time between the two machines.

+1
source

All Articles