JDK-4103650 : Exception in java.util.zip.InflaterInputStream
  • Type: Bug
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1998-01-13
  • Updated: 1998-04-24
  • Resolved: 1998-04-24
Related Reports
Duplicate :  
Description

Name: dgC58589			Date: 01/13/98


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)
======================================================================

Comments
WORK AROUND Name: dgC58589 Date: 01/13/98 As is.read(b) should return 0 at the point of the exception, just treat the exception as a real EOF ======================================================================
11-06-2004