re PR libgcj/4728 (java.util.zip.GZIPOutputStream.write(int) doesn't update CRC)

* java/util/zip/GZIPOutputStream.java (write(int)): New method.
	Fixes PR libgcj/4728.

From-SVN: r46618
This commit is contained in:
Tom Tromey 2001-10-29 21:50:07 +00:00 committed by Tom Tromey
parent 54ee97997a
commit 0db58ea45f
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2001-10-29 Tom Tromey <tromey@redhat.com>
* java/util/zip/GZIPOutputStream.java (write(int)): New method.
Fixes PR libgcj/4728.
2001-10-27 Tom Tromey <tromey@redhat.com> 2001-10-27 Tom Tromey <tromey@redhat.com>
* include/jni.h (struct JNINativeInterface) [GetStringLength]: * include/jni.h (struct JNINativeInterface) [GetStringLength]:

View file

@ -1,5 +1,5 @@
/* GZIPOutputStream.java - Create a file in gzip format /* GZIPOutputStream.java - Create a file in gzip format
Copyright (C) 1999, 2000 Free Software Foundation, Inc. Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -78,6 +78,12 @@ public class GZIPOutputStream extends DeflaterOutputStream
crc = new CRC32 (); crc = new CRC32 ();
} }
public synchronized void write (int bval) throws IOException
{
super.write (bval);
crc.update (bval);
}
public synchronized void write (byte[] buf) throws IOException public synchronized void write (byte[] buf) throws IOException
{ {
write (buf, 0, buf.length); write (buf, 0, buf.length);