Solved

PROBLEMS WITH java.util.zip.ZipInputStream  class

Posted on 1998-12-10
5
567 Views
Last Modified: 2008-02-20
Hello...
I am having a problem when I unzip a file with java.util.zip.ZipInputStream class
the error is "invalid compression method"
but when I unzip the same file using winzip, I don't have this problem...
Is there another version of this class that I can use or another way to unzip this file?

thanks


0
Comment
Question by:dorock
  • 3
5 Comments
 
LVL 8

Expert Comment

by:diakov
ID: 1229162
Lets clarify. The zip package can unzip only files produced by it self. Is this the case?

Nik.
0
 

Author Comment

by:dorock
ID: 1229163
>Lets clarify. The zip package can unzip only files produced by >it self. Is this the case?
>Nik.
No Nik, I can unzip others files produced by others programs...
I think the problem is that this file uses an older compressiom method...

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1229164
>>    I think the problem is that this file uses an older compressiom method...
maybe yes ...

can you send me example .zip file (heyhey@nettaxi.com)
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1229165
hi, dorock,

Did you receive my letter. If you like my answer, I can post it here. If you are not satisfied you can very easy delete the question ...

best regards
  heyhey
0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 20 total points
ID: 1229166
i tried your .zip file, and of course i received
   java.lang.InternalError: invalid compression method
after some researching i found that your zip file is compressed with IMPLODE method

 Length  Method   Size  Ratio   Date    Time    CRC-32  Attr  Name
 ------  ------   ----- -----   ----    ----   -------- ----  ----
 403744  Implode  42336  90%  12-14-98  18:31  c44757bf --w-  BDIN
 ------          ------  ---                                  -------
 403744           42336  90%                                        1

 and java.util.zip (at least in JDK 1.1.6) supports only DEFLATED and STORED methods ...


switch (entry.method) {
case DEFLATED:
    len = super.read(b, off, len);
// ....
    return len;
case STORED:
    if (remaining <= 0)
//    ....
    return len;
default:
    throw new InternalError("invalid compression method");


i just don't have time to check in my books what are the differences between these methods (as far as i remember there are
3/4/5 types of
codeing in .zip files) ... and if some of the are not used nowadays ...
but it seems that DEFLATED compression is better than IMPLODE

your zip is
42422 bytes IMPLODED
40030 bytes DEFLATED

so i suppose that DEFLATE is some older - not so effective - method ...
maybe you've used too old Zip utility when you've packed the zip file ?

that's all for now
if you have more questions, please post them ...

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now