mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-05 20:59:47 +08:00
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:
parent
b19ee4bd24
commit
57b4edef7d
@ -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):
|
||||
|
@ -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,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.
|
||||
|
Loading…
Reference in New Issue
Block a user