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
This commit is contained in:
Mark Wielaard 2003-10-27 11:02:44 +00:00 committed by Mark Wielaard
parent b19ee4bd24
commit 57b4edef7d
3 changed files with 25 additions and 21 deletions

View 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):

View File

@ -116,7 +116,6 @@ public class JarInputStream extends ZipInputStream
}
firstEntry = (JarEntry) super.getNextEntry();
}
closeEntry();
if (verify)
{

View 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,30 +140,29 @@ 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
{
if (inbufLength > 0)
{
def.setInput (inbuf, 0, inbufLength);
deflate ();
inbufLength = 0;
}
inbufWrite ();
def.setInput (buf, off, len);
deflate ();
}
private void inbufWrite () throws IOException
{
if (inbufLength > 0)
{
int size = inbufLength;
inbufLength = 0;
write (inbuf, 0, size);
}
}
// Used, if needed, for write(int).
private byte[] inbuf;
// Used length of inbuf.