java.util.zip
Class ZipInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--java.util.zip.InflaterInputStream
|
+--java.util.zip.ZipInputStream
All Implemented Interfaces:
java.util.zip.ZipConstants
This is a FilterInputStream that reads the files in an zip archive
one after another. It has a special method to get the zip entry of
the next file. The zip entry contains information about the file name
size, compressed size, CRC, etc.
It includes support for STORED and DEFLATED entries.
Author:ZipInputStream
public ZipInputStream(java.io.InputStream in)
Creates a new Zip input stream, reading a zip archive.
Parameters:
available
public int available()
close
public void close()
Closes the zip file.
Throws:
closeEntry
public void closeEntry()
Closes the current zip entry and moves to the next one.
createZipEntry
protected ZipEntry createZipEntry(java.lang.String name)
Creates a new zip entry for the given name. This is equivalent
to new ZipEntry(name).
Parameters:
getNextEntry
public ZipEntry getNextEntry()
Open the next entry from the zip archive, and return its description.
If the previous entry wasn't closed, this method will close it.
read
public int read()
Reads a byte from the current zip entry.
Returns:
Throws:
read
public int read(byte[] b, int off, int len)
Reads a block of bytes from the current zip entry.
Parameters:
Returns:
- the number of bytes read (may be smaller, even before
EOF), or -1 on EOF.
Throws: