]> gcc.gnu.org Git - gcc.git/commitdiff
Reported by Helmer Kraemer <hkraemer@freenet.de>
authorMark Wielaard <mark@klomp.org>
Mon, 27 Oct 2003 11:02:44 +0000 (11:02 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Mon, 27 Oct 2003 11:02:44 +0000 (11:02 +0000)
       Reported by Helmer Kraemer <hkraemer@freenet.de>
       * java/util/jar/JarInputStream.java (readManifest): Don't call
       closeEntry().

       * java/util/zip/DeflaterOutputStream.java (inbufWrite): New method.
       (finish): Use inbufWrite().
       (write(int)): Likewise.
       (write(byte[],int,int)): Likewise.

From-SVN: r72976

libjava/ChangeLog
libjava/java/util/jar/JarInputStream.java
libjava/java/util/zip/DeflaterOutputStream.java

index d4c19813d11a5ef7be4306e24aea2cc922099634..a7fe99ad1ccbcb33e4994f22499cb6f0830a565d 100644 (file)
@@ -1,3 +1,14 @@
+2003-10-26  Mark Wielaard  <mark@klomp.org>
+
+       Reported by Helmer Kraemer <hkraemer@freenet.de>
+       * java/util/jar/JarInputStream.java (readManifest): Don't call
+       closeEntry().
+
+       * java/util/zip/DeflaterOutputStream.java (inbufWrite): New method.
+       (finish): Use inbufWrite().
+       (write(int)): Likewise.
+       (write(byte[],int,int)): Likewise.
+
 2003-10-26  Bryce McKinlay  <bryce@mckinlay.net.nz>
 
        * java/lang/reflect/AccessibleObject.java (secureSetAccessible):
index 9c295f372e619e7fe394946bf526191698f2299e..daf935fa70a0cfee6d9153d99faf0931fc60e3b9 100644 (file)
@@ -116,7 +116,6 @@ public class JarInputStream extends ZipInputStream
          }
        firstEntry = (JarEntry) super.getNextEntry();
       }
-    closeEntry();
 
     if (verify)
       {
index ff66b080f9ef2976d19d463ea6eea1343b7d0145..6a4fa95886bd73e712137553cc228fae1674af9d 100644 (file)
@@ -127,12 +127,7 @@ public class DeflaterOutputStream extends FilterOutputStream
    */
   public void finish () throws IOException
   {
-    if (inbufLength > 0)
-      {
-       def.setInput (inbuf, 0, inbufLength);
-       deflate ();
-       inbufLength = 0;
-      }
+    inbufWrite();
     def.finish();
     while (! def.finished ())
       {
@@ -145,28 +140,27 @@ public class DeflaterOutputStream extends FilterOutputStream
   public void write (int bval) throws IOException
   {
     if (inbuf == null)
-      {
-       inbuf = new byte[128];
-      }
+      inbuf = new byte[128];
     else if (inbufLength == inbuf.length)
-      {
-       def.setInput (inbuf, 0, inbufLength);
-       deflate ();
-       inbufLength = 0;
-      }
+      inbufWrite ();
     inbuf[inbufLength++] = (byte) bval;
   }
 
   public void write (byte[] buf, int off, int len) throws IOException
+  {
+    inbufWrite ();
+    def.setInput (buf, off, len);
+    deflate ();
+  }
+
+  private void inbufWrite () throws IOException
   {
     if (inbufLength > 0)
       {
-       def.setInput (inbuf, 0, inbufLength);
-       deflate ();
+       int size = inbufLength;
        inbufLength = 0;
+       write (inbuf, 0, size);
       }
-    def.setInput (buf, off, len);
-    deflate ();
   }
 
   // Used, if needed, for write(int).
This page took 0.081806 seconds and 5 git commands to generate.