61 |
private int method; |
private int method; |
62 |
private int flags; |
private int flags; |
63 |
private int avail; |
private int avail; |
64 |
|
private boolean entryAtEOF; |
65 |
|
|
66 |
/** |
/** |
67 |
* Creates a new Zip input stream, reading a zip archive. |
* Creates a new Zip input stream, reading a zip archive. |
151 |
return null; |
return null; |
152 |
} |
} |
153 |
if (header != LOCSIG) |
if (header != LOCSIG) |
154 |
throw new ZipException("Wrong Local header signature" + Integer.toHexString(header)); |
throw new ZipException("Wrong Local header signature" |
155 |
|
+ Integer.toHexString(header)); |
156 |
/* skip version */ |
/* skip version */ |
157 |
readLeShort(); |
readLeShort(); |
158 |
flags = readLeShort(); |
flags = readLeShort(); |
173 |
String name = new String(buffer); |
String name = new String(buffer); |
174 |
|
|
175 |
entry = createZipEntry(name); |
entry = createZipEntry(name); |
176 |
|
entryAtEOF = false; |
177 |
entry.setMethod(method); |
entry.setMethod(method); |
178 |
if ((flags & 8) == 0) |
if ((flags & 8) == 0) |
179 |
{ |
{ |
255 |
if (method == ZipOutputStream.DEFLATED) |
if (method == ZipOutputStream.DEFLATED) |
256 |
inf.reset(); |
inf.reset(); |
257 |
entry = null; |
entry = null; |
258 |
|
entryAtEOF = true; |
259 |
} |
} |
260 |
|
|
261 |
public int available() throws IOException |
public int available() throws IOException |
262 |
{ |
{ |
263 |
return entry != null ? 1 : 0; |
return entryAtEOF ? 0 : 1; |
264 |
} |
} |
265 |
|
|
266 |
/** |
/** |
339 |
throw new ZipException("CRC mismatch"); |
throw new ZipException("CRC mismatch"); |
340 |
crc.reset(); |
crc.reset(); |
341 |
entry = null; |
entry = null; |
342 |
|
entryAtEOF = true; |
343 |
} |
} |
344 |
return len; |
return len; |
345 |
} |
} |
353 |
super.close(); |
super.close(); |
354 |
crc = null; |
crc = null; |
355 |
entry = null; |
entry = null; |
356 |
|
entryAtEOF = true; |
357 |
} |
} |
358 |
|
|
359 |
/** |
/** |