aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/util')
-rw-r--r--libjava/java/util/zip/ZipEntry.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/libjava/java/util/zip/ZipEntry.java b/libjava/java/util/zip/ZipEntry.java
index 9ff7f4d..cf8d98b 100644
--- a/libjava/java/util/zip/ZipEntry.java
+++ b/libjava/java/util/zip/ZipEntry.java
@@ -19,7 +19,7 @@ package java.util.zip;
* Status: Believed complete and correct.
*/
-public class ZipEntry implements ZipConstants
+public class ZipEntry implements ZipConstants, Cloneable
{
// These values were determined using a simple test program.
public static final int STORED = 0;
@@ -51,10 +51,20 @@ public class ZipEntry implements ZipConstants
crc = ent.crc;
extra = ent.extra;
method = ent.method;
+ name = ent.name;
size = ent.size;
time = ent.time;
relativeOffset = ent.relativeOffset;
}
+
+ public Object clone ()
+ {
+ // JCL defines this as being the same as the copy constructor above,
+ // except that value of the "extra" field is also copied.
+ ZipEntry clone = new ZipEntry (this);
+ clone.extra = (byte[]) extra.clone ();
+ return clone;
+ }
public String getComment () { return comment; }
@@ -89,6 +99,13 @@ public class ZipEntry implements ZipConstants
throw new IllegalArgumentException ();
this.comment = comment;
}
+
+ public void setCompressedSize (long compressedSize)
+ {
+ if (size < 0 || size > 0xffffffffL)
+ throw new IllegalArgumentException ();
+ this.compressedSize = compressedSize;
+ }
public void setCrc (long crc)
{
@@ -155,4 +172,6 @@ public class ZipEntry implements ZipConstants
}
public String toString () { return name; }
+
+ public int hashCode () { return name.hashCode (); }
}