Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4103650
Votes 0
Synopsis Exception in java.util.zip.InflaterInputStream
Category java:jar
Reported Against 1.2beta2
Release Fixed
State 11-Closed, duplicate of 4040920, bug
Priority: 3-Medium
Related Bugs 4040920
Submit Date 13-JAN-1998
Description




Use jar -cvfM or WinZip to compress:

java/text/resources/LocaleElements_pl.java
java/lang/Math.java

Then use the following code to uncompress:

import java.io.*;
import java.util.zip.*;
final class show {
        public static void main(final String args[]) throws IOException {
                final ZipFile zf = new ZipFile(args[0]);
                final ZipEntry ze = zf.getEntry(args[1]);
                final InputStream is = zf.getInputStream(ze);
                byte[] b = new byte[1];
                while (is.read(b) > 0) System.out.write(b);
                is.close();
        }
}

java show <archive> <file>
...
java.io.EOFException: Unexpected end of ZLIB input stream
        at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:156)
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:119)
        at java.io.FilterInputStream.read(FilterInputStream.java:109)
        at show.main(show.java:10)

(Review ID: 23030)
======================================================================
Work Around




As is.read(b) should return 0 at the point of the
exception, just treat the exception as a real EOF
======================================================================
Evaluation
N/A
Comments
  
  Include a link with my name & email   

Submitted On 14-APR-2000
glamp
Yes, we rediscovered this problem in jdk 1.2.2.  We are catching the EOF exception and ending.  This should 
really be fixed!!! And this bug report should not be closed. fix it now!


Submitted On 19-MAR-2002
ispringer
I still see this problem in JDK 1.3.1_02 for certain 
zipfiles...


Submitted On 16-NOV-2003
h.shinoda
I see this problem in JDK 1.3.1_05.

java.io.EOFException: Unexpected end of ZLIB input stream
        at java.util.zip.InflaterInputStream.fill
(InflaterInputStream.java:209)
        at java.util.zip.InflaterInputStream.read
(InflaterInputStream.java:131)
        at java.util.zip.ZipInputStream.read
(ZipInputStream.java:137)
        at java.util.zip.ZipInputStream.closeEntry
(ZipInputStream.java:88)
        at gdms.tenpufile.servlet.FileIO.readzip(FileIO.java:754)
        at gdms.tenpufile.servlet.testThread.main
(testThread.java:23)



PLEASE NOTE: JDK6 is formerly known as Project Mustang