106 |
/** |
/** |
107 |
* Opens a Zip file reading the given File in the given mode. |
* Opens a Zip file reading the given File in the given mode. |
108 |
* |
* |
109 |
* If the OPEN_DELETE mode is specified, the zip file will be deleted at some time moment |
* If the OPEN_DELETE mode is specified, the zip file will be deleted at |
110 |
* after it is opened. It will be deleted before the zip file is closed or the Virtual Machine |
* some time moment after it is opened. It will be deleted before the zip |
111 |
* exits. |
* file is closed or the Virtual Machine exits. |
112 |
* |
* |
113 |
* The contents of the zip file will be accessible until it is closed. |
* The contents of the zip file will be accessible until it is closed. |
114 |
* |
* |
125 |
{ |
{ |
126 |
if ((mode & OPEN_DELETE) != 0) |
if ((mode & OPEN_DELETE) != 0) |
127 |
{ |
{ |
128 |
throw new IllegalArgumentException("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile"); |
throw new IllegalArgumentException |
129 |
|
("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile"); |
130 |
} |
} |
131 |
this.raf = new RandomAccessFile(file, "r"); |
this.raf = new RandomAccessFile(file, "r"); |
132 |
this.name = file.getName(); |
this.name = file.getName(); |
138 |
* @exception IOException if a i/o error occured. |
* @exception IOException if a i/o error occured. |
139 |
* @exception EOFException if the file ends prematurely |
* @exception EOFException if the file ends prematurely |
140 |
*/ |
*/ |
141 |
private final int readLeShort(DataInput di) throws IOException { |
private final int readLeShort(DataInput di) throws IOException |
142 |
|
{ |
143 |
byte[] b = new byte[2]; |
byte[] b = new byte[2]; |
144 |
di.readFully(b); |
di.readFully(b); |
145 |
return (b[0] & 0xff) | (b[1] & 0xff) << 8; |
return (b[0] & 0xff) | (b[1] & 0xff) << 8; |
150 |
* @exception IOException if a i/o error occured. |
* @exception IOException if a i/o error occured. |
151 |
* @exception EOFException if the file ends prematurely |
* @exception EOFException if the file ends prematurely |
152 |
*/ |
*/ |
153 |
private final int readLeInt(DataInput di) throws IOException { |
private final int readLeInt(DataInput di) throws IOException |
154 |
|
{ |
155 |
byte[] b = new byte[4]; |
byte[] b = new byte[4]; |
156 |
di.readFully(b); |
di.readFully(b); |
157 |
return ((b[0] & 0xff) | (b[1] & 0xff) << 8) |
return ((b[0] & 0xff) | (b[1] & 0xff) << 8) |