• Post Reply Bookmark Topic Watch Topic
  • New Topic

Faster alternative(s) to java.util.zip??  RSS feed

 
juan velez
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had to rewrite in Java (1.5) an old c-based code that used PKZIP to compress some input(parameter) files. The problem is one of the requirements for this conversion was to keep at least the same performance as the old one. But unfortunately, creating zip files using java.util.zip is at least 50% slower than PKZIP. Are there any faster java-based alternatives to java.util.zip? I know one good alternative is to just to call PKZIP as the old c-based code but I'd rather not as we'd like to get rid of that 3rd party tool.

Thanks

Juan
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jakarta Commons Compress also has a zip component, but I know nothing about its performance.
 
André Asantos
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf, how are you?


Could you post an exemple using Jakarta Commons Compress? Something like compressing a folder to a .zip...
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://commons.apache.org/compress/examples.html
 
André Asantos
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, thanks for helping me, but sorry I already saw that but I thought very bad exemple from Apache I didn't understand anything, I need to compress a folder/directory to .zip...
 
anver sadhat
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Hope the following code snippet will help Some one.

 
Shankar Raghavan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Small issue in this code snippet - I think you are forgetting to close the input stream here:




I would do something like this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!