+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):
*/
public void finish () throws IOException
{
- if (inbufLength > 0)
- {
- def.setInput (inbuf, 0, inbufLength);
- deflate ();
- inbufLength = 0;
- }
+ inbufWrite();
def.finish();
while (! def.finished ())
{
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).