add ZipFile(File) constructor and ZipFile.close

This commit is contained in:
Joel Dice 2008-10-06 17:30:48 -06:00
parent 114bf777bb
commit aeafb52bcb

View File

@ -10,6 +10,7 @@
package java.util.zip;
import java.io.File;
import java.io.RandomAccessFile;
import java.io.InputStream;
import java.io.IOException;
@ -54,6 +55,10 @@ public class ZipFile {
}
}
public ZipFile(File file) throws IOException {
this(file.getAbsolutePath());
}
public int size() {
return index.size();
}
@ -177,6 +182,10 @@ public class ZipFile {
return get2(w, p + 28);
}
public void close() throws IOException {
file.close();
}
private static class Window {
private final RandomAccessFile file;
public final byte[] data;