This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: java.util.zip
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 29 Apr 2003 09:38:20 +0200
- Subject: FYI: Patch: java.util.zip
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commited the attached patch to trunk to make java.util.zip a little
more merged with classpath.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+rivvWSOgCCdjSDsRAtrJAKCLiLVfG3Y8LP4dTIg0GliHeKfEiACeOy9O
AiKMvFP9iyNf2IBn/A14ipY=
=2WoR
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1857
diff -u -r1.1857 ChangeLog
--- ChangeLog 28 Apr 2003 18:19:22 -0000 1.1857
+++ ChangeLog 29 Apr 2003 07:35:47 -0000
@@ -1,3 +1,9 @@
+2003-04-29 Michael Koch <konqueror at gmx dot de>
+
+ * java/util/zip/Deflater.java,
+ java/util/zip/DeflaterOutputStream.java:
+ Partly merged with classpath.
+
2003-04-27 Tom Tromey <tromey at redhat dot com>
* java/lang/natString.cc (_Jv_AllocString): Initialize
Index: java/util/zip/Deflater.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/Deflater.java,v
retrieving revision 1.9
diff -u -r1.9 Deflater.java
--- java/util/zip/Deflater.java 22 Jan 2002 22:40:41 -0000 1.9
+++ java/util/zip/Deflater.java 29 Apr 2003 07:35:47 -0000
@@ -7,7 +7,7 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -51,15 +51,41 @@
public class Deflater
{
+ /**
+ * The best and slowest compression level. This tries to find very
+ * long and distant string repetitions.
+ */
public static final int BEST_COMPRESSION = 9;
+ /**
+ * The worst but fastest compression level.
+ */
public static final int BEST_SPEED = 1;
+ /**
+ * The default compression level.
+ */
public static final int DEFAULT_COMPRESSION = -1;
+ /**
+ * This level won't compress at all but output uncompressed blocks.
+ */
public static final int NO_COMPRESSION = 0;
+ /**
+ * The default strategy.
+ */
public static final int DEFAULT_STRATEGY = 0;
public static final int FILTERED = 1;
+
+ /**
+ * This strategy will not look for string repetitions at all. It
+ * only encodes with Huffman trees (which means, that more common
+ * characters get a smaller encoding.
+ */
public static final int HUFFMAN_ONLY = 2;
+ /**
+ * The compression method. This is the only method supported so far.
+ * There is no need to use this constant at all.
+ */
public static final int DEFLATED = 8;
public int deflate (byte[] buf)
Index: java/util/zip/DeflaterOutputStream.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/zip/DeflaterOutputStream.java,v
retrieving revision 1.7
diff -u -r1.7 DeflaterOutputStream.java
--- java/util/zip/DeflaterOutputStream.java 22 Jan 2002 22:40:41 -0000 1.7
+++ java/util/zip/DeflaterOutputStream.java 29 Apr 2003 07:35:47 -0000
@@ -7,7 +7,7 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -41,16 +41,22 @@
import java.io.OutputStream;
import java.io.IOException;
-/**
- * @author Tom Tromey
- * @date May 17, 1999
- */
-
/* Written using on-line Java Platform 1.2 API Specification
* and JCL book.
* Believed complete and correct.
*/
+/**
+ * This is a special FilterOutputStream deflating the bytes that are
+ * written through it. It uses the Deflater for deflating.
+ *
+ * A special thing to be noted is that flush() doesn't flush
+ * everything in Sun's JDK, but it does so in jazzlib. This is because
+ * Sun's Deflater doesn't have a way to flush() everything, without
+ * finishing the stream.
+ *
+ * @author Tom Tromey, Jochen Hoenicke
+ */
public class DeflaterOutputStream extends FilterOutputStream
{
public void close () throws IOException