This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
[PATCH] java.util.zip javadoc updates
- To: java-patches at sources dot redhat dot com
- Subject: [PATCH] java.util.zip javadoc updates
- From: Mark Wielaard <mark at klomp dot org>
- Date: Thu, 16 Nov 2000 01:57:39 +0100
Hi,
The following are some updates to the javadoc of the java.util.zip
classes. Only documentation changes, no code change. I wanted to
import the sources into Classpath when all javadoc was finished (it
is not finished yet) so I also changed the copyright header to the
standard Classpath header. I hope that is ok to commit.
* java/util/zip/*.java: Javadoc updates.
Cheers,
Mark
Index: Adler32.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/Adler32.java,v
retrieving revision 1.4
diff -u -u -r1.4 Adler32.java
--- Adler32.java 2000/08/20 21:51:19 1.4
+++ Adler32.java 2000/11/16 00:56:30
@@ -1,18 +1,31 @@
-/* Copyright (C) 1999 Free Software Foundation
+/* Adler.java - Computes Adler32 data checksum of a data stream
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
-/**
- * @author Per Bothner
- * @date April 6, 1999.
- */
-
/*
* Written using on-line Java Platform 1.2 API Specification, as well
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
@@ -20,31 +33,67 @@
* Status: Believed complete and correct.
*/
+/**
+ * Computes Adler32 data checksum of a data stream.
+ * The actual Adler32 algorithm is described in RFC 1950
+ * (ZLIB Compressed Data Format Specification version 3.3).
+ * Can be used to get the CRC32 over a stream if used with checked input/output
+ * streams.
+ *
+ * @see InflaterInputStream
+ * @see InflaterOutputStream
+ *
+ * @author Per Bothner
+ * @date April 6, 1999.
+ */
public class Adler32 implements Checksum
{
- private static int BASE = 65521; /* largest prime smaller than 65536 */
+ /** largest prime smaller than 65536 */
+ private static int BASE = 65521;
+
private int s1;
private int s2;
+ /**
+ * Creates an Adler32 data checksum.
+ */
public Adler32 ()
{
reset();
}
+ /**
+ * Resets the Adler32 data checksum as if no update was ever called.
+ */
public void reset () { s1 = 1; s2 = 0; }
+ /**
+ * Adds one byte to the data checksum.
+ *
+ * @param bval the data value to add. The high byte of the int is ignored.
+ */
public void update (int bval)
{
s1 = (s1 + (bval & 0xFF)) % BASE;
s2 = (s1 + s2) % BASE;
}
+ /**
+ * Adds the complete byte array to the data checksum.
+ */
public void update (byte[] buffer)
{
update(buffer, 0, buffer.length);
}
+ /**
+ * Adds the byte array to the data checksum.
+ *
+ * @param buf the buffer which contains the data
+ * @param off the offset in the buffer where the data starts
+ * @param len the length of the data
+ */
public void update (byte[] buf, int off, int len)
{
int s1 = this.s1;
@@ -68,34 +117,11 @@
this.s2 = s2;
}
+ /**
+ * Returns the Adler32 data checksum computed so far.
+ */
public long getValue()
{
return ((long) s2 << 16) + s1;
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: CRC32.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/CRC32.java,v
retrieving revision 1.4
diff -u -u -r1.4 CRC32.java
--- CRC32.java 2000/08/20 21:51:19 1.4
+++ CRC32.java 2000/11/16 00:56:30
@@ -1,18 +1,31 @@
-/* Copyright (C) 1999 Free Software Foundation
+/* CRC32.java - Computes CRC32 data checksum of a data stream
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
-/**
- * @author Per Bothner
- * @date April 1, 1999.
- */
-
/*
* Written using on-line Java Platform 1.2 API Specification, as well
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
@@ -20,14 +33,29 @@
* Status: Believed complete and correct.
*/
+/**
+ * Computes CRC32 data checksum of a data stream.
+ * The actual CRC32 algorithm is described in RFC 1952
+ * (GZIP file format specification version 4.3).
+ * Can be used to get the CRC32 over a stream if used with checked input/output
+ * streams.
+ *
+ * @see InflaterInputStream
+ * @see InflaterOutputStream
+ *
+ * @author Per Bothner
+ * @date April 1, 1999.
+ */
public class CRC32 implements Checksum
{
+ /** The crc data checksum so far. */
private int crc = 0;
+ /** The fast CRC table. Computed once when the CRC32 class is loaded. */
private static int[] crc_table = make_crc_table();
- /* Make the table for a fast CRC. */
- static int[] make_crc_table ()
+ /** Make the table for a fast CRC. */
+ private static int[] make_crc_table ()
{
int[] crc_table = new int[256];
for (int n = 0; n < 256; n++)
@@ -45,11 +73,17 @@
return crc_table;
}
+ /**
+ * Returns the CRC32 data checksum computed so far.
+ */
public long getValue ()
{
return (long) crc & 0xffffffffL;
}
+ /**
+ * Resets the CRC32 data checksum as if no update was ever called.
+ */
public void reset () { crc = 0; }
public void update (int bval)
@@ -59,6 +93,13 @@
crc = ~c;
}
+ /**
+ * Adds the byte array to the data checksum.
+ *
+ * @param buf the buffer which contains the data
+ * @param off the offset in the buffer where the data starts
+ * @param len the length of the data
+ */
public void update (byte[] buf, int off, int len)
{
int c = ~crc;
@@ -66,5 +107,9 @@
c = crc_table[(c ^ buf[off++]) & 0xff] ^ (c >>> 8);
crc = ~c;
}
+
+ /**
+ * Adds the complete byte array to the data checksum.
+ */
public void update (byte[] buf) { update(buf, 0, buf.length); }
}
Index: CheckedInputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/CheckedInputStream.java,v
retrieving revision 1.4
diff -u -u -r1.4 CheckedInputStream.java
--- CheckedInputStream.java 2000/08/20 21:51:19 1.4
+++ CheckedInputStream.java 2000/11/16 00:56:30
@@ -1,42 +1,74 @@
-// CheckedInputStream.java - Compute checksum of data being read.
+/* CheckedInputStream.java - Compute checksum of data being read
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
package java.util.zip;
import java.io.FilterInputStream;
import java.io.InputStream;
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.
*/
+/**
+ * InputStream that computes a checksum of the data being read using a
+ * supplied Checksum object.
+ *
+ * @see Checksum
+ *
+ * @author Tom Tromey
+ * @date May 17, 1999
+ */
public class CheckedInputStream extends FilterInputStream
{
+ /**
+ * Creates a new CheckInputStream on top of the supplied OutputStream
+ * using the supplied Checksum.
+ */
public CheckedInputStream (InputStream in, Checksum sum)
{
super (in);
this.sum = sum;
}
+ /**
+ * Returns the Checksum object used. To get the data checksum computed so
+ * far call <code>getChecksum.getValue()</code>.
+ */
public Checksum getChecksum ()
{
return sum;
}
+ /**
+ * Reads one byte, updates the checksum and returns the read byte
+ * (or -1 when the end of file was reached).
+ */
public int read () throws IOException
{
int x = in.read();
@@ -45,6 +77,11 @@
return x;
}
+ /**
+ * Reads at most len bytes in the supplied buffer and updates the checksum
+ * with it. Returns the number of bytes actually read or -1 when the end
+ * of file was reached.
+ */
public int read (byte[] buf, int off, int len) throws IOException
{
int r = in.read(buf, off, len);
@@ -53,6 +90,11 @@
return r;
}
+ /**
+ * Skips n bytes by reading them in a temporary buffer and updating the
+ * the checksum with that buffer. Returns the actual number of bytes skiped
+ * which can be less then requested when the end of file is reached.
+ */
public long skip (long n) throws IOException
{
if (n == 0)
@@ -76,6 +118,6 @@
return s;
}
- // The checksum object.
+ /** The checksum object. */
private Checksum sum;
}
Index: CheckedOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/CheckedOutputStream.java,v
retrieving revision 1.3
diff -u -u -r1.3 CheckedOutputStream.java
--- CheckedOutputStream.java 2000/03/07 19:55:28 1.3
+++ CheckedOutputStream.java 2000/11/16 00:56:30
@@ -1,54 +1,88 @@
-// CheckedOutputStream.java - Compute checksum of data being written.
+/* CheckedOutputStream.java - Compute checksum of data being written.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
package java.util.zip;
import java.io.FilterOutputStream;
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.
*/
+/**
+ * OutputStream that computes a checksum of data being written using a
+ * supplied Checksum object.
+ *
+ * @see Checksum
+ *
+ * @author Tom Tromey
+ * @date May 17, 1999
+ */
public class CheckedOutputStream extends FilterOutputStream
{
+ /**
+ * Creates a new CheckInputStream on top of the supplied OutputStream
+ * using the supplied Checksum.
+ */
public CheckedOutputStream (OutputStream out, Checksum cksum)
{
super (out);
this.sum = cksum;
}
+ /**
+ * Returns the Checksum object used. To get the data checksum computed so
+ * far call <code>getChecksum.getValue()</code>.
+ */
public Checksum getChecksum ()
{
return sum;
}
+ /**
+ * Writes one byte to the OutputStream and updates the Checksum.
+ */
public void write (int bval) throws IOException
{
out.write(bval);
sum.update(bval);
}
+ /**
+ * Writes the byte array to the OutputStream and updates the Checksum.
+ */
public void write (byte[] buf, int off, int len) throws IOException
{
out.write(buf, off, len);
sum.update(buf, off, len);
}
- // The checksum object.
+ /** The checksum object. */
private Checksum sum;
}
Index: Checksum.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/Checksum.java,v
retrieving revision 1.3
diff -u -u -r1.3 Checksum.java
--- Checksum.java 2000/03/07 19:55:28 1.3
+++ Checksum.java 2000/11/16 00:56:30
@@ -1,31 +1,75 @@
-/* Copyright (C) 1999 Free Software Foundation
+/* Checksum.java - Interface to compute a data checksum
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
-/**
- * @author Per Bothner
- * @date January 9, 1999.
- */
-
/*
* Written using on-line Java Platform 1.2 API Specification, as well
* as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
* Status: Believed complete and correct.
*/
+/**
+ * Interface to compute a data checksum used by checked input/output streams.
+ * A data checksum can be updated by one byte or with a byte array. After each
+ * update the value of the current checksum can be returned by calling
+ * <code>getValue</code>. The complete checksum object can also be reset
+ * so it can be used again with new data.
+ *
+ * @see CheckedInputStream
+ * @see CheckedOutputStream
+ *
+ * @author Per Bothner
+ * @date January 9, 1999.
+ */
public interface Checksum
{
+ /**
+ * Returns the data checksum computed so far.
+ */
public long getValue ();
+ /**
+ * Resets the data checksum as if no update was ever called.
+ */
public void reset ();
+ /**
+ * Adds one byte to the data checksum.
+ *
+ * @param bval the data value to add. The high byte of the int is ignored.
+ */
public void update (int bval);
+ /**
+ * Adds the byte array to the data checksum.
+ *
+ * @param buf the buffer which contains the data
+ * @param off the offset in the buffer where the data starts
+ * @param len the length of the data
+ */
public void update (byte[] buf, int off, int len);
}
Index: DataFormatException.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/DataFormatException.java,v
retrieving revision 1.4
diff -u -u -r1.4 DataFormatException.java
--- DataFormatException.java 2000/03/07 19:55:28 1.4
+++ DataFormatException.java 2000/11/16 00:56:30
@@ -1,13 +1,29 @@
-// DataFormatException.java
+/* DataformatException.java - Exception thrown when compressed data is corrupt
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libjava.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
-This software is copyrighted work licensed under the terms of the
-Libjava License. Please consult the file "LIBJAVA_LICENSE" for
-details. */
-
package java.util.zip;
/**
@@ -19,6 +35,9 @@
* Believed complete and correct.
*/
+/**
+ * Exception thrown when compressed data is corrupt.
+ */
public class DataFormatException extends Exception
{
public DataFormatException ()
Index: Deflater.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/Deflater.java,v
retrieving revision 1.6
diff -u -u -r1.6 Deflater.java
--- Deflater.java 2000/03/07 19:55:28 1.6
+++ Deflater.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// Deflater.java - Compress a data stream.
+/* Deflater.java - Compress a data stream
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: DeflaterOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/DeflaterOutputStream.java,v
retrieving revision 1.4
diff -u -u -r1.4 DeflaterOutputStream.java
--- DeflaterOutputStream.java 2000/03/07 19:55:28 1.4
+++ DeflaterOutputStream.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// DeflaterOutputStream.java - Output filter for compressing.
+/* DeflaterOutputStream.java - Output filter for compressing.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: GZIPInputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/GZIPInputStream.java,v
retrieving revision 1.3
diff -u -u -r1.3 GZIPInputStream.java
--- GZIPInputStream.java 2000/03/07 19:55:28 1.3
+++ GZIPInputStream.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// GZIPInputStream.java - Input tiler for reading gzip file.
+/* GZIPInputStream.java - Input filter for reading gzip file
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: GZIPOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/GZIPOutputStream.java,v
retrieving revision 1.4
diff -u -u -r1.4 GZIPOutputStream.java
--- GZIPOutputStream.java 2000/03/07 19:55:28 1.4
+++ GZIPOutputStream.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// 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 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: Inflater.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/Inflater.java,v
retrieving revision 1.4
diff -u -u -r1.4 Inflater.java
--- Inflater.java 2000/03/07 19:55:28 1.4
+++ Inflater.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// Inflater.java - Decompress a data stream.
+/* Inflater.java - Decompress a data stream
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: InflaterInputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/InflaterInputStream.java,v
retrieving revision 1.8
diff -u -u -r1.8 InflaterInputStream.java
--- InflaterInputStream.java 2000/08/24 22:48:12 1.8
+++ InflaterInputStream.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// InflaterInputStream.java - Input stream filter for decompressing.
+/* InflaterInputStream.java - Input stream filter for decompressing
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: ZipConstants.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipConstants.java,v
retrieving revision 1.4
diff -u -u -r1.4 ZipConstants.java
--- ZipConstants.java 2000/03/07 19:55:28 1.4
+++ ZipConstants.java 2000/11/16 00:56:30
@@ -1,13 +1,39 @@
-/* Copyright (C) 1999 Free Software Foundation
+/* ZipConstants.java - Some constants used in the zip package
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
+
package java.util.zip;
+/**
+ * Some constants used in the zip package.
+ * <p>
+ * Since this package local interface is completely undocumented no effort
+ * is made to make it compatible with other implementations.
+ * If someone is really interested you can probably come up with the right
+ * constants and documentation by studying the Info-ZIP zipfile.c constants.
+ */
interface ZipConstants
{
// Size in bytes of local file header, including signature.
Index: ZipEntry.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipEntry.java,v
retrieving revision 1.11
diff -u -u -r1.11 ZipEntry.java
--- ZipEntry.java 2000/08/20 21:51:19 1.11
+++ ZipEntry.java 2000/11/16 00:56:30
@@ -1,10 +1,28 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* ZipEntry.java - Represents entries in a zip file archive
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
@@ -19,6 +37,12 @@
* Status: Believed complete and correct.
*/
+/**
+ * Represents entries in a zip file archive.
+ * An Entry cn be created by giving a name or by giving an already existing
+ * ZipEntries whose values should be copied. The name normally represents a
+ * file path name or directory name.
+ */
public class ZipEntry implements ZipConstants, Cloneable
{
// These values were determined using a simple test program.
@@ -44,6 +68,16 @@
this.name = name;
}
+ /**
+ * Creates a new ZipEntry using the fields of a given ZipEntry.
+ * The comment, compressedSize, crc, extra, method, name, size, time and
+ * relativeOffset fields are copied from the given entry.
+ * Note that the contents of the extra byte array field is not cloned,
+ * only the reference is copied.
+ * The clone() method does clone the contents of the extra byte array if
+ * needed.
+ * @since 1.2
+ */
public ZipEntry (ZipEntry ent)
{
comment = ent.comment;
@@ -56,7 +90,13 @@
time = ent.time;
relativeOffset = ent.relativeOffset;
}
-
+
+ /**
+ * Creates a clone of this ZipEntry. Calls <code>new ZipEntry (this)</code>
+ * and creates a clone of the contents of the extra byte array field.
+ *
+ * @since 1.2
+ */
public Object clone ()
{
// JCL defines this as being the same as the copy constructor above,
@@ -99,7 +139,12 @@
throw new IllegalArgumentException ();
this.comment = comment;
}
-
+
+ /**
+ * Sets the compressedSize of this ZipEntry.
+ * The new size must be between 0 and 0xffffffffL.
+ * @since 1.2
+ */
public void setCompressedSize (long compressedSize)
{
if (compressedSize < 0 || compressedSize > 0xffffffffL)
@@ -172,6 +217,9 @@
}
public String toString () { return name; }
-
+
+ /**
+ * Returns the hashcode of the name of this ZipEntry.
+ */
public int hashCode () { return name.hashCode (); }
}
Index: ZipException.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipException.java,v
retrieving revision 1.3
diff -u -u -r1.3 ZipException.java
--- ZipException.java 2000/03/07 19:55:28 1.3
+++ ZipException.java 2000/11/16 00:56:30
@@ -1,12 +1,28 @@
-// ZipException.java
+/* ZipException.java - Exception representing a zip related error
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libjava.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
-This software is copyrighted work licensed under the terms of the
-Libjava License. Please consult the file "LIBJAVA_LICENSE" for
-details. */
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
Index: ZipFile.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipFile.java,v
retrieving revision 1.14
diff -u -u -r1.14 ZipFile.java
--- ZipFile.java 2000/09/04 21:20:27 1.14
+++ ZipFile.java 2000/11/16 00:56:30
@@ -1,14 +1,31 @@
-// ZipFile.java - Read contents of a ZIP file.
+/* ZipFile.java - Read contents of a ZIP file
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
-/* Copyright (C) 1999, 2000 Free Software Foundation
+This file is part of GNU Classpath.
- This file is part of libgcj.
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
-
package java.util.zip;
+
import java.io.*;
/* Written using on-line Java Platform 1.2 API Specification
@@ -166,6 +183,12 @@
return name;
}
+ /**
+ * Returns the number of entries in this ZipFile.
+ * @exception IllegalStateException if the ZipFile has been closed.
+ *
+ * @since 1.2
+ */
public int size ()
{
if (entries == null)
Index: ZipInputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipInputStream.java,v
retrieving revision 1.10
diff -u -u -r1.10 ZipInputStream.java
--- ZipInputStream.java 2000/08/20 21:51:19 1.10
+++ ZipInputStream.java 2000/11/16 00:56:31
@@ -1,10 +1,28 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* ZipInputStream.java - Input filter for reading zip file
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
package java.util.zip;
import java.io.*;
@@ -20,8 +38,6 @@
* Status: Quite incomplete, but can read uncompressed .zip archives.
*/
-// JDK1.2 has "protected ZipEntry createZipEntry(String)" but is very
-// vague about what the method does. FIXME.
// We do not calculate the CRC and compare it with the specified value;
// we probably should. FIXME.
@@ -123,6 +139,13 @@
}
}
+ /**
+ * Creates a new ZipEntry with the given name.
+ * Used by ZipInputStream when normally <code>new ZipEntry (name)</code>
+ * would be called. This gives subclasses such as JarInputStream a change
+ * to override this method and add aditional information to the ZipEntry
+ * (subclass).
+ */
protected ZipEntry createZipEntry (String name)
{
return new ZipEntry (name);
@@ -160,6 +183,11 @@
return count;
}
+ /**
+ * Returns 0 if the ZipInputStream is closed and 1 otherwise.
+ *
+ * @since 1.2
+ */
public int available() {
if (closed)
return 0;
@@ -226,6 +254,11 @@
}
}
+ /**
+ * Closes this InflaterInputStream.
+ *
+ * @since 1.2
+ */
public void close () throws IOException
{
current = null;
Index: ZipOutputStream.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/zip/ZipOutputStream.java,v
retrieving revision 1.7
diff -u -u -r1.7 ZipOutputStream.java
--- ZipOutputStream.java 2000/03/07 19:55:28 1.7
+++ ZipOutputStream.java 2000/11/16 00:56:31
@@ -1,12 +1,31 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation
+/* ZipOutputStream.java - Create a file in zip format
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
- This file is part of libgcj.
+This file is part of GNU Classpath.
-This software is copyrighted work licensed under the terms of the
-Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
-details. */
+GNU Classpath is free software; you can redistribute it and/or modify
+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
+General Public License for more details.
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+As a special exception, if you link this library with other files to
+produce an executable, this library does not by itself cause the
+resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License. */
+
package java.util.zip;
+
import java.io.*;
/* Written using on-line Java Platform 1.2 API Specification