File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes ZipOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "ZipOutputStream" Watch "ZipOutputStream" New topic


Craig Parsons
Ranch Hand

Joined: Jan 28, 2004
Posts: 40
I am running a simple compression program I found on the web. I'm trying to get a better idea of how it works. It runs OK but the final Zip file isn't compressed. I am compressing 2 pictures which are about 1.6 MB total but the final zip file is also 1.6 MB. Attached is my source.
Any suggestions?
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

JPG's are already compressed, so it's unlikely they will be compressed further (otherwise, what's to stop you from compressing and re-compressing until you have 1 bit?). Try it with text files. They compress dramatically.

[How To Ask Questions On JavaRanch]
Craig Parsons
Ranch Hand

Joined: Jan 28, 2004
Posts: 40
That was it.
I agree. Here's the link:
subject: ZipOutputStream
It's not a secret anymore!