[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: Fixed GZIP constants

Kaffe CVS cvs-commits at kaffe.org
Thu Oct 14 12:47:07 PDT 2004


PatchSet 5287 
Date: 2004/10/14 19:42:55
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: Fixed GZIP constants

2004-10-14  Dalibor Topic <robilad at kaffe.org>

        * libraries/javalib/java/util/zip/GZIPInputStream.java,
        libraries/javalib/java/util/zip/GZIPOutputStream.java:
        Resynced with GNU Classpath.

        2004-10-12  Michael Koch  <konqueror at gmx.de>

        * java/util/zip/GZIPInputStream.java
        (GZIP_MAGIC): Fixed value.
        (readHeader): Fixed GZIP_MAGIC handling.
        * java/util/zip/GZIPOutputStream.java
        (GZIPOutputStream): Likewise.

Members: 
	ChangeLog:1.2839->1.2840 
	libraries/javalib/java/util/zip/GZIPInputStream.java:1.12->1.13 
	libraries/javalib/java/util/zip/GZIPOutputStream.java:1.8->1.9 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2839 kaffe/ChangeLog:1.2840
--- kaffe/ChangeLog:1.2839	Thu Oct 14 12:47:59 2004
+++ kaffe/ChangeLog	Thu Oct 14 19:42:55 2004
@@ -1,3 +1,17 @@
+2004-10-14  Dalibor Topic <robilad at kaffe.org>
+
+	* libraries/javalib/java/util/zip/GZIPInputStream.java,
+	libraries/javalib/java/util/zip/GZIPOutputStream.java:
+        Resynced with GNU Classpath.
+
+	2004-10-12  Michael Koch  <konqueror at gmx.de>
+
+        * java/util/zip/GZIPInputStream.java
+        (GZIP_MAGIC): Fixed value.
+        (readHeader): Fixed GZIP_MAGIC handling.
+        * java/util/zip/GZIPOutputStream.java
+        (GZIPOutputStream): Likewise.
+
 2004-10-14  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
Index: kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java
diff -u kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.12 kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.13
--- kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java:1.12	Wed Apr 21 14:59:06 2004
+++ kaffe/libraries/javalib/java/util/zip/GZIPInputStream.java	Thu Oct 14 19:42:57 2004
@@ -55,7 +55,7 @@
   /**
    * The magic number found at the start of a GZIP stream.
    */
-  public static final int GZIP_MAGIC = 0x1f8b;
+  public static final int GZIP_MAGIC = 0x8b1f;
 
   /**
    * The mask for bit 0 of the flag byte.
@@ -198,12 +198,12 @@
       return;
     }
     headCRC.update(magic);
-    if (magic != (GZIP_MAGIC >> 8))
-      throw new IOException("Error in GZIP header, first byte doesn't match");
-    
-    magic = in.read();
     if (magic != (GZIP_MAGIC & 0xff))
       throw new IOException("Error in GZIP header, second byte doesn't match");
+    
+    magic = in.read();
+    if (magic != (GZIP_MAGIC >> 8))
+      throw new IOException("Error in GZIP header, first byte doesn't match");
     headCRC.update(magic);
     
     /* 2. Check the compression type (must be 8) */
Index: kaffe/libraries/javalib/java/util/zip/GZIPOutputStream.java
diff -u kaffe/libraries/javalib/java/util/zip/GZIPOutputStream.java:1.8 kaffe/libraries/javalib/java/util/zip/GZIPOutputStream.java:1.9
--- kaffe/libraries/javalib/java/util/zip/GZIPOutputStream.java:1.8	Mon Jul 26 21:14:00 2004
+++ kaffe/libraries/javalib/java/util/zip/GZIPOutputStream.java	Thu Oct 14 19:42:58 2004
@@ -86,8 +86,8 @@
     byte[] gzipHeader =
       {
 	/* The two magic bytes */
-	(byte) (GZIPInputStream.GZIP_MAGIC >> 8),
 	(byte) GZIPInputStream.GZIP_MAGIC,
+	(byte) (GZIPInputStream.GZIP_MAGIC >> 8),
 	  
 	/* The compression type */
 	(byte) Deflater.DEFLATED,



More information about the kaffe mailing list