java.lang.Object | ||||
↳ | java.io.InputStream | |||
↳ | java.io.FilterInputStream | |||
↳ | java.util.zip.InflaterInputStream | |||
↳ | java.util.zip.ZipInputStream |
Known Direct Subclasses |
This class provides an implementation of FilterInputStream
that
uncompresses data from a ZIP-archive input stream.
A ZIP-archive is a collection of compressed (or uncompressed) files -
the so called ZIP entries. Therefore when reading from a ZipInputStream
first the entry's attributes will be retrieved with getNextEntry
before its data is read.
While InflaterInputStream
can read a compressed ZIP-archive
entry, this extension can read uncompressed entries as well.
Use ZipFile
if you can access the archive as a file directly.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | CENATT | ||||||||||
int | CENATX | ||||||||||
int | CENCOM | ||||||||||
int | CENCRC | ||||||||||
int | CENDSK | ||||||||||
int | CENEXT | ||||||||||
int | CENFLG | ||||||||||
int | CENHDR | ||||||||||
int | CENHOW | ||||||||||
int | CENLEN | ||||||||||
int | CENNAM | ||||||||||
int | CENOFF | ||||||||||
long | CENSIG | ||||||||||
int | CENSIZ | ||||||||||
int | CENTIM | ||||||||||
int | CENVEM | ||||||||||
int | CENVER | ||||||||||
int | ENDCOM | ||||||||||
int | ENDHDR | ||||||||||
int | ENDOFF | ||||||||||
long | ENDSIG | ||||||||||
int | ENDSIZ | ||||||||||
int | ENDSUB | ||||||||||
int | ENDTOT | ||||||||||
int | EXTCRC | ||||||||||
int | EXTHDR | ||||||||||
int | EXTLEN | ||||||||||
long | EXTSIG | ||||||||||
int | EXTSIZ | ||||||||||
int | LOCCRC | ||||||||||
int | LOCEXT | ||||||||||
int | LOCFLG | ||||||||||
int | LOCHDR | ||||||||||
int | LOCHOW | ||||||||||
int | LOCLEN | ||||||||||
int | LOCNAM | ||||||||||
long | LOCSIG | ||||||||||
int | LOCSIZ | ||||||||||
int | LOCTIM | ||||||||||
int | LOCVER |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.util.zip.InflaterInputStream
| |||||||||||
From class
java.io.FilterInputStream
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
ZipInputStream from the specified input stream. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns 0 when when this stream has exhausted its input; and 1 otherwise.
| |||||||||||
Closes this
ZipInputStream . | |||||||||||
Closes the current ZIP entry and positions to read the next entry.
| |||||||||||
Reads the next entry from this
ZipInputStream or null if
no more entries are present. | |||||||||||
Reads up to the specified number of uncompressed bytes into the buffer
starting at the offset.
| |||||||||||
Skips up to the specified number of bytes in the current ZIP entry.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
creates a
ZipEntry with the given name. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.util.zip.InflaterInputStream
| |||||||||||
From class java.io.FilterInputStream
| |||||||||||
From class java.io.InputStream
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.io.Closeable
|
Constructs a new ZipInputStream
from the specified input stream.
stream | the input stream to representing a ZIP archive. |
---|
Returns 0 when when this stream has exhausted its input; and 1 otherwise. A result of 1 does not guarantee that further bytes can be returned, with or without blocking.
Although consistent with the RI, this behavior is inconsistent with
available()
, and violates the Liskov
Substitution Principle. This method should not be used.
IOException |
---|
Closes this ZipInputStream
.
IOException | if an IOException occurs.
|
---|
Closes the current ZIP entry and positions to read the next entry.
IOException | if an IOException occurs.
|
---|
Reads the next entry from this ZipInputStream
or null
if
no more entries are present.
ZipEntry
contained in the input stream.IOException | if an IOException occurs. |
---|
Reads up to the specified number of uncompressed bytes into the buffer starting at the offset.
buffer | a byte array |
---|---|
start | the starting offset into the buffer |
length | the number of bytes to read |
IOException |
---|
Skips up to the specified number of bytes in the current ZIP entry.
value | the number of bytes to skip. |
---|
IOException | if an IOException occurs.
|
---|
creates a ZipEntry
with the given name.
name | the name of the entry. |
---|
ZipEntry
.