java.util.zip question

G

GaryM

I was compressing a bunch of files (about 200) using a java program I
wrote. Comparing winzip versus my program I noticed the former
compresses better by a factor of about 4x on "Normal" compression.

I am using Deflated and "best compression" for method and level
respectively in my Java program.

I was wondering if the inputstream buffer size adversely affects the
end result of the zip file? Most examples I see use buffer of about 1K.
Is it possible with java to get comparable results to winzip?
 
R

Roedy Green

I was wondering if the inputstream buffer size adversely affects the
end result of the zip file? Most examples I see use buffer of about 1K.
Is it possible with java to get comparable results to winzip?

Unfortunately Phil Katz put in the ability to use proprietary
compression formats into Zip formatted files. This destroys
interoperability. If he were more altruistic, he might have thought
to allow that only if the code for the algorithm were put in the
public domain.

Both Winzip and PkZip have proprietary formats and algorithms.

Java supports only a fraction of what the commercial packages do.
You can't use Java reliably for unpacking files created by Winzip or
PkZip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top