|
@@ -24,6 +24,7 @@ public class AndroidZipEntry implements ZipConstants, Cloneable {
|
|
|
private static Calendar cal;
|
|
private static Calendar cal;
|
|
|
|
|
|
|
|
private final String name;
|
|
private final String name;
|
|
|
|
|
+ private final int nameLen;
|
|
|
private int size;
|
|
private int size;
|
|
|
private int compressedSize;
|
|
private int compressedSize;
|
|
|
private int crc;
|
|
private int crc;
|
|
@@ -54,13 +55,15 @@ public class AndroidZipEntry implements ZipConstants, Cloneable {
|
|
|
* @throws NullPointerException when name is null.
|
|
* @throws NullPointerException when name is null.
|
|
|
* @throws IllegalArgumentException when name is bigger then 65535 chars.
|
|
* @throws IllegalArgumentException when name is bigger then 65535 chars.
|
|
|
*/
|
|
*/
|
|
|
- public AndroidZipEntry(String name) {
|
|
|
|
|
- int length = name.length();
|
|
|
|
|
- if (length > 65535)
|
|
|
|
|
- throw new IllegalArgumentException("name length is " + length);
|
|
|
|
|
|
|
+ public AndroidZipEntry(String name, int nameLen) {
|
|
|
|
|
+ //int length = name.length();
|
|
|
|
|
+ this.nameLen = nameLen;
|
|
|
|
|
+ if (nameLen > 65535)
|
|
|
|
|
+ throw new IllegalArgumentException("name length is " + nameLen);
|
|
|
this.name = name;
|
|
this.name = name;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Creates a copy of the given zip entry.
|
|
* Creates a copy of the given zip entry.
|
|
|
*
|
|
*
|
|
@@ -68,6 +71,7 @@ public class AndroidZipEntry implements ZipConstants, Cloneable {
|
|
|
*/
|
|
*/
|
|
|
public AndroidZipEntry(AndroidZipEntry e) {
|
|
public AndroidZipEntry(AndroidZipEntry e) {
|
|
|
name = e.name;
|
|
name = e.name;
|
|
|
|
|
+ nameLen = e.nameLen;
|
|
|
known = e.known;
|
|
known = e.known;
|
|
|
size = e.size;
|
|
size = e.size;
|
|
|
compressedSize = e.compressedSize;
|
|
compressedSize = e.compressedSize;
|
|
@@ -116,6 +120,10 @@ public class AndroidZipEntry implements ZipConstants, Cloneable {
|
|
|
return name;
|
|
return name;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public int getNameLen() {
|
|
|
|
|
+ return nameLen;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Sets the time of last modification of the entry.
|
|
* Sets the time of last modification of the entry.
|
|
|
*
|
|
*
|