InflaterInputStream.java (read): Throw ZipException if inflater throws a DataFormatEx...
authorTom Tromey <tromey@cygnus.com>
Wed, 23 Jun 1999 14:57:14 +0000 (14:57 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 23 Jun 1999 14:57:14 +0000 (14:57 +0000)
* java/util/zip/InflaterInputStream.java (read): Throw
ZipException if inflater throws a DataFormatException.

From-SVN: r27719

libjava/ChangeLog
libjava/java/util/zip/InflaterInputStream.java

index 1581108..9bd1842 100644 (file)
@@ -1,3 +1,8 @@
+1999-06-23  Tom Tromey  <tromey@cygnus.com>
+
+       * java/util/zip/InflaterInputStream.java (read): Throw
+       ZipException if inflater throws a DataFormatException.
+
 1999-06-23  Warren Levy  <warrenl@cygnus.com>
 
        * java/net/DatagramSocketImpl.java (localPort): Fixed typo to match JDK.
index 7ee4455..7471247 100644 (file)
@@ -67,7 +67,14 @@ public class InflaterInputStream extends FilterInputStream
       fill ();
     if (inf.needsDictionary())
       return -1;
-    return inf.inflate(buf, off, len);
+    try
+      {
+       return inf.inflate(buf, off, len);
+      }
+    catch (DataFormatException dfe)
+      {
+       throw new ZipException (dfe.getMessage());
+      }
   }
 
   public long skip (long n) throws IOException