diff options
| author | Michael Koch <konqueror@gmx.de> | 2004-10-12 14:21:48 +0000 |
|---|---|---|
| committer | Michael Koch <konqueror@gmx.de> | 2004-10-12 14:21:48 +0000 |
| commit | 86f52644848b046c10db68ea59750fa2e81cdc22 (patch) | |
| tree | dcafe520729de69bda07d260215b561710cb6227 /java/util/zip/GZIPInputStream.java | |
| parent | b13a9aa8168f0245e9e5c1780938f04026749d17 (diff) | |
| download | classpath-86f52644848b046c10db68ea59750fa2e81cdc22.tar.gz | |
2004-10-12 Michael Koch <konqueror@gmx.de>
* java/util/zip/GZIPInputStream.java
(GZIP_MAGIC): Fixed value.
(readHeader): Fixed GZIP_MAGIC handling.
* java/util/zip/GZIPOutputStream.java
(GZIPOutputStream): Likewise.
Diffstat (limited to 'java/util/zip/GZIPInputStream.java')
| -rw-r--r-- | java/util/zip/GZIPInputStream.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/java/util/zip/GZIPInputStream.java b/java/util/zip/GZIPInputStream.java index 117cf69d9..1c9793312 100644 --- a/java/util/zip/GZIPInputStream.java +++ b/java/util/zip/GZIPInputStream.java @@ -55,7 +55,7 @@ public class GZIPInputStream /** * 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 @@ public class GZIPInputStream 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) */ |
