Commit 57b4edef by Mark Wielaard Committed by Mark Wielaard

Reported by Helmer Kraemer <hkraemer@freenet.de>

       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
parent b19ee4bd
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):
......
......@@ -116,7 +116,6 @@ public class JarInputStream extends ZipInputStream
}
firstEntry = (JarEntry) super.getNextEntry();
}
closeEntry();
if (verify)
{
......
......@@ -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).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment