| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
InputStream is = …;
ZipInputStream zis = new ZipInputStream(is);
Based on 35 examples
public class ZipInputStream extends InflaterInputStream implements ZipConstants
This class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.
Field Summary |
---|
Fields inherited from class java.util.zip.InflaterInputStream |
---|
buf, inf, len |
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
Creates a new ZIP input stream. |
Method Summary | |
---|---|
int |
Returns 0 after EOF has reached for the current entry data, otherwise always return 1. |
void |
close() Closes this input stream and releases any system resources associated with the stream. |
void |
Closes the current ZIP entry and positions the stream for reading the next entry. |
protected ZipEntry |
createZipEntry(String name) Creates a new ZipEntry object for the specified
entry name.
|
ZipEntry |
Reads the next ZIP file entry and positions the stream at the beginning of the entry data. |
int |
read(byte[] b, int off, int len) Reads from the current ZIP entry into an array of bytes. |
long |
skip(long n) Skips specified number of bytes in the current ZIP entry. |
Methods inherited from class java.util.zip.InflaterInputStream |
---|
available, close, fill, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZipInputStream(InputStream in)
in
- the actual input streamMethod Detail |
---|
public int available() throws IOException
Programs should not count on this method to return the actual number of bytes that could be read without blocking.
available
in class InflaterInputStream
IOException
- if an I/O error occurs.public void close() throws IOException
close
in class InflaterInputStream
IOException
- if an I/O error has occurredpublic void closeEntry() throws IOException
IOException
- if an I/O error has occurredprotected ZipEntry createZipEntry(String name)
ZipEntry
object for the specified
entry name.
name
- the ZIP file entry namepublic ZipEntry getNextEntry() throws IOException
IOException
- if an I/O error has occurredpublic int read(byte[] b, int off, int len) throws IOException
len
is not zero, the method
blocks until some input is available; otherwise, no
bytes are read and 0
is returned.
read
in class InflaterInputStream
b
- the buffer into which the data is readoff
- the start offset in the destination array b
len
- the maximum number of bytes readIOException
- if an I/O error has occurredpublic long skip(long n) throws IOException
skip
in class InflaterInputStream
n
- the number of bytes to skipIOException
- if an I/O error has occurred
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |