Build 1.0_r1(from source)

java.util.zip
Class ZipInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.util.zip.InflaterInputStream
              extended by java.util.zip.ZipInputStream
All Implemented Interfaces:
Closeable, ZipConstants
Direct Known Subclasses:
JarInputStream

public class ZipInputStream
extends InflaterInputStream
implements ZipConstants

ZipInputStream is an input stream for reading zip files.

See Also:
ZipEntry, ZipFile

Field Summary
(package private)  ZipEntry currentEntry
           
(package private) static int DEFLATED
           
(package private) static int STORED
           
(package private) static int ZIPDataDescriptorFlag
           
(package private) static int ZIPLocalHeaderVersionNeeded
           
 
Fields inherited from class java.util.zip.InflaterInputStream
buf, BUF_SIZE, closed, eof, inf, len, nativeEndBufSize
 
Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from interface java.util.zip.ZipConstants
CENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTLEN, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER
 
Constructor Summary
ZipInputStream(InputStream stream)
          Constructs a new ZipInputStream on the specified input stream.
 
Method Summary
 int available()
          Returns 1 if the EOF has been reached, otherwise returns 0.
 void close()
          Closes this ZipInputStream.
 void closeEntry()
          Closes the current zip entry and positions to read the next entry.
protected  ZipEntry createZipEntry(String name)
           
 ZipEntry getNextEntry()
          Reads the next zip entry from this ZipInputStream.
 int read(byte[] buffer, int start, int length)
          Reads up to the specified number of uncompressed bytes into the buffer starting at the offset.
 long skip(long value)
          Skips up to the specified number of bytes in the current zip entry.
 
Methods inherited from class java.util.zip.InflaterInputStream
fill, mark, markSupported, read, reset
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFLATED

static final int DEFLATED
See Also:
Constant Field Values

STORED

static final int STORED
See Also:
Constant Field Values

ZIPDataDescriptorFlag

static final int ZIPDataDescriptorFlag
See Also:
Constant Field Values

ZIPLocalHeaderVersionNeeded

static final int ZIPLocalHeaderVersionNeeded
See Also:
Constant Field Values

currentEntry

ZipEntry currentEntry
Constructor Detail

ZipInputStream

public ZipInputStream(InputStream stream)
Constructs a new ZipInputStream on the specified input stream.

Parameters:
stream - the input stream
Method Detail

close

public void close()
           throws IOException
Closes this ZipInputStream.

Specified by:
close in interface Closeable
Overrides:
close in class InflaterInputStream
Throws:
IOException - If an error occurs closing the stream

closeEntry

public void closeEntry()
                throws IOException
Closes the current zip entry and positions to read the next entry.

Throws:
IOException

getNextEntry

public ZipEntry getNextEntry()
                      throws IOException
Reads the next zip entry from this ZipInputStream.

Throws:
IOException

read

public int read(byte[] buffer,
                int start,
                int length)
         throws IOException
Reads up to the specified number of uncompressed bytes into the buffer starting at the offset.

Overrides:
read in class InflaterInputStream
Parameters:
buffer - a byte array
start - the starting offset into the buffer
length - the number of bytes to read
Returns:
the number of bytes read
Throws:
IOException - If an error occurs reading

skip

public long skip(long value)
          throws IOException
Skips up to the specified number of bytes in the current zip entry.

Overrides:
skip in class InflaterInputStream
Parameters:
value - the number of bytes to skip
Returns:
the number of bytes skipped
Throws:
IOException - If an error occurs skipping

available

public int available()
              throws IOException
Returns 1 if the EOF has been reached, otherwise returns 0.

Overrides:
available in class InflaterInputStream
Returns:
0 after EOF of current entry, 1 otherwise
Throws:
IOException - If an error occurs

createZipEntry

protected ZipEntry createZipEntry(String name)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature