Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

query about java.util.zip package

 
lalit patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Actually I want to know what are BestCompression, BestSpeed, DefaultStratagy compression algorithms stands for ? I saw java Doc but could not find any thing. Any help ?

Thanks in advance...

Best regards


lalit patel
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

ZIP supports several compression algorithms. Some are faster than others, while some produce smaller files than others. Usually, the faster they are, the lower the compression factor gets. These parameters let you choose which strategy to pursue (for those cases where compression factor or (de)compression time matters). Personally, I have never encountered a situation where the defaults weren't good enough.

As a further example, BZIP2 generally creates smaller files than ZIP, but it takes noticeably longer to compress and decompress.

If you're interested in the gory details, the source code for the java.util.zip package comes with the JDK, so you can look at what those options do in detail.
[ September 05, 2008: Message edited by: Ulf Dittmer ]
 
lalit patel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer for your quick response,

But I just want to know what these compression algorihtm(BestCompression,BestSpeed etc) consist of?
Like Deflated compression algorith is an implementation of LZW and Huffman compression algorithm.

any help?

thanks once again.

lalit patel
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is somewhat academic, because the javadocs for the Deflater class state that the only supported algorithm is DEFLATE. So all those levels amount to the same algorithm.
[ September 05, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!