* java/util/zip/*.java: Javadoc and copyright updates.
authorMark Wielaard <mark@klomp.org>
Fri, 17 Nov 2000 21:42:28 +0000 (21:42 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Fri, 17 Nov 2000 21:42:28 +0000 (21:42 +0000)
From-SVN: r37526

19 files changed:
libjava/ChangeLog
libjava/java/util/zip/Adler32.java
libjava/java/util/zip/CRC32.java
libjava/java/util/zip/CheckedInputStream.java
libjava/java/util/zip/CheckedOutputStream.java
libjava/java/util/zip/Checksum.java
libjava/java/util/zip/DataFormatException.java
libjava/java/util/zip/Deflater.java
libjava/java/util/zip/DeflaterOutputStream.java
libjava/java/util/zip/GZIPInputStream.java
libjava/java/util/zip/GZIPOutputStream.java
libjava/java/util/zip/Inflater.java
libjava/java/util/zip/InflaterInputStream.java
libjava/java/util/zip/ZipConstants.java
libjava/java/util/zip/ZipEntry.java
libjava/java/util/zip/ZipException.java
libjava/java/util/zip/ZipFile.java
libjava/java/util/zip/ZipInputStream.java
libjava/java/util/zip/ZipOutputStream.java

index bf5b81a7d0b9af7dcbf33adbe26746d528814283..2b604bd7963d13c66ab8ff094969f68375bac0bb 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-17  Mark Wielaard  <mark@klomp.org>
+
+       * java/util/zip/*.java: Javadoc updates.
+
 2000-11-17  Tom Tromey  <tromey@cygnus.com>
 
        * java/text/CollationKey.java: Implement Comparable.
index e7afeabde164ce2487292e3b5e981ecd45b8fc1a..989a2049283db0ab337bdf833cefe1b160db1e89 100644 (file)
@@ -1,18 +1,31 @@
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* Adler.java - Computes Adler32 data checksum of a data stream
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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 @@ package java.util.zip;
  * 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 @@ public class Adler32 implements Checksum
     this.s2 = s2;
   }
 
+  /**
+   * Returns the Adler32 data checksum computed so far.
+   */
   public long getValue()
   {
     return ((long) s2 << 16) + s1;
   }
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index 1abbcad1d9779c6cb76ed451c42de890cb9ed981..c6d9ed4ede2819deeb7c434529fd5e35506a0303 100644 (file)
@@ -1,17 +1,30 @@
-/* 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.
 
-package java.util.zip;
+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.
 
-/**
- * @author Per Bothner
- * @date April 1, 1999.
- */
+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;
 
 /*
  * Written using on-line Java Platform 1.2 API Specification, as well
@@ -20,14 +33,29 @@ package java.util.zip;
  * 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 @@ public class CRC32 implements Checksum
     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 @@ public class CRC32 implements Checksum
     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 @@ public class CRC32 implements Checksum
       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 0901743e6a7ece70aca667d6af036beeb6d0bdd5..80a7bb660d000f42933c2919ab3975dc917f96bb 100644 (file)
@@ -1,12 +1,28 @@
-// CheckedInputStream.java - Compute checksum of data being read.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* CheckedInputStream.java - Compute checksum of data being read
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
@@ -14,29 +30,45 @@ 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 @@ public class CheckedInputStream extends FilterInputStream
     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 @@ public class CheckedInputStream extends FilterInputStream
     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 @@ public class CheckedInputStream extends FilterInputStream
     return s;
   }
 
-  // The checksum object.
+  /** The checksum object. */
   private Checksum sum;
 }
index a6323037cd7a9c9660e377563262122991d1e017..276f498096293cb2aaf86e416c649c0dbd031dd7 100644 (file)
@@ -1,12 +1,28 @@
-// 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.
 
-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;
 
@@ -14,41 +30,59 @@ 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 e37d1834e04415e15bb8a1123d38d324ced21d43..f9f214e4f2a6a786127ed687301eaad5949db9f6 100644 (file)
@@ -1,17 +1,30 @@
-/* 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.
 
-package java.util.zip;
+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.
 
-/**
- * @author Per Bothner
- * @date January 9, 1999.
- */
+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;
 
 /*
  * Written using on-line Java Platform 1.2 API Specification, as well
@@ -19,13 +32,44 @@ package java.util.zip;
  * 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 10d1616cdd6ff00b59675449fbba0788593b0276..eae4a2a89ed63f03d8949110010deae900fba593 100644 (file)
@@ -1,12 +1,28 @@
-// DataFormatException.java
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libjava.
-
-This software is copyrighted work licensed under the terms of the
-Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
-details.  */
+/* DataformatException.java - Exception thrown when compressed data is corrupt
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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 +35,9 @@ package java.util.zip;
  * Believed complete and correct.
  */
 
+/**
+ * Exception thrown when compressed data is corrupt.
+ */
 public class DataFormatException extends Exception
 {
   public DataFormatException ()
index 6cf82a795509044200de78733952ac59b009dac5..63208324a200f7fb694e156bb23e75be62829a77 100644 (file)
@@ -1,12 +1,28 @@
-// Deflater.java - Compress a data stream.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* Deflater.java - Compress a data stream
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index 410d886810637683e6cb606872926e40e0ba3d9f..d4218fa5cc5d068381238d644ade6e5d64069dfc 100644 (file)
@@ -1,12 +1,28 @@
-// DeflaterOutputStream.java - Output filter for compressing.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* DeflaterOutputStream.java - Output filter for compressing.
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index bea5eb38b1d51648ed3c463710a8e66475f854e3..4279e90c5b1996342eea7423f09b14a1efdb4fd2 100644 (file)
@@ -1,12 +1,28 @@
-// GZIPInputStream.java - Input tiler for reading gzip file.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* GZIPInputStream.java - Input filter for reading gzip file
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index be117273cde56f8222db540a33b03bcaea646ef4..cf62fb7c6bf4135e51b2e36dcc1684129e8e59a8 100644 (file)
@@ -1,12 +1,28 @@
-// GZIPOutputStream.java - Create a file in gzip format.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* GZIPOutputStream.java - Create a file in gzip format
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index dc2e24dec1e52ed7eb1d723c69dceef7643d58fb..eb3512ae58346e9e82b4bd05645a2d2ce87e9107 100644 (file)
@@ -1,12 +1,28 @@
-// Inflater.java - Decompress a data stream.
-
-/* Copyright (C) 1999  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* Inflater.java - Decompress a data stream
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index 3db1b2a1eb3289748ca0a712ad469221ac53dd02..005c82179d1d2baf164e2306fc21b2e5f625b789 100644 (file)
@@ -1,12 +1,28 @@
-// InflaterInputStream.java - Input stream filter for decompressing.
-
-/* Copyright (C) 1999, 2000  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* InflaterInputStream.java - Input stream filter for decompressing
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index 3e3cd8a1c3727754e623349ce912614342c141a5..1313d48aa695dd25da51433c41eea28f23954f37 100644 (file)
@@ -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 99cb3aacb2212f6cc85c7083c5bf66c18a9e3e1f..c3a8023c55bd6de630dd4ebb9f4deee9369a5259 100644 (file)
@@ -1,10 +1,28 @@
-/* Copyright (C) 1999, 2000  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* ZipEntry.java - Represents entries in a zip file archive
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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 @@ package java.util.zip;
  * 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 @@ public class ZipEntry implements ZipConstants, Cloneable
     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 @@ public class ZipEntry implements ZipConstants, Cloneable
     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 @@ public class ZipEntry implements ZipConstants, Cloneable
       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 class ZipEntry implements ZipConstants, Cloneable
   }
 
   public String toString () { return name; }
-  
+  /**
+   * Returns the hashcode of the name of this ZipEntry.
+   */
   public int hashCode () { return name.hashCode (); }
 }
index a4a119c7480e4594ab80fe11cd700d9ef79d8633..b9b63c7b1942088c6ec78f045291f5d981846c46 100644 (file)
@@ -1,12 +1,28 @@
-// ZipException.java
-
-/* Copyright (C) 1998, 1999  Free Software Foundation
-
-   This file is part of libjava.
-
-This software is copyrighted work licensed under the terms of the
-Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
-details.  */
+/* ZipException.java - Exception representing a zip related error
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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;
 
index 58e2748fd12e2265c946d2bb00831c4b3eb9b99c..d0dbb9276dc440d1b3612a86441d50e40a25f53e 100644 (file)
@@ -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.
 
-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;
+
 import java.io.*;
 
 /* Written using on-line Java Platform 1.2 API Specification
@@ -166,6 +183,12 @@ public class ZipFile implements ZipConstants
     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 b50cc7be5927bb0250c435f1f92acc5a27067939..1836859f0527b1be37a477fc0499a79d5ac27d97 100644 (file)
@@ -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 @@ import java.io.*;
  * 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.
    
@@ -127,6 +143,13 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
       }
   }
 
+  /**
+   * 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);
@@ -168,6 +191,11 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
     return count;
   }
 
+  /**
+   * Returns 0 if the ZipInputStream is closed and 1 otherwise.
+   *
+   * @since 1.2
+   */
   public int available()
   {
     return closed ? 0 : 1;
@@ -232,6 +260,11 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
       }
   }
 
+  /**
+   * Closes this InflaterInputStream.
+   *
+   * @since 1.2
+   */
   public void close ()  throws IOException
   {
     current = null;
index afd5664ca28a9fe90abba35710adbb664c1cc5f3..a0a8ed744bb9fb5611f7c099bf98d3c4cb005b48 100644 (file)
@@ -1,12 +1,31 @@
-/* Copyright (C) 1999, 2000  Free Software Foundation
-
-   This file is part of libgcj.
-
-This software is copyrighted work licensed under the terms of the
-Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
-details.  */
+/* ZipOutputStream.java - Create a file in zip format
+   Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+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