Package Summary  Overview Summary

class:ZipInputStream [NONE]

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    JarInputStream

    public class ZipInputStream
    extends InflaterInputStream
    
    This class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries.
    Since:
    1.1

field:LOCSIG [NONE]

field:EXTSIG [NONE]

field:CENSIG [NONE]

field:ENDSIG [NONE]

field:LOCHDR [NONE]

field:EXTHDR [NONE]

field:CENHDR [NONE]

field:ENDHDR [NONE]

field:LOCVER [NONE]

field:LOCFLG [NONE]

field:LOCHOW [NONE]

field:LOCTIM [NONE]

field:LOCCRC [NONE]

field:LOCSIZ [NONE]

field:LOCLEN [NONE]

field:LOCNAM [NONE]

field:LOCEXT [NONE]

field:EXTCRC [NONE]

field:EXTSIZ [NONE]

field:EXTLEN [NONE]

field:CENVEM [NONE]

field:CENVER [NONE]

field:CENFLG [NONE]

field:CENHOW [NONE]

field:CENTIM [NONE]

field:CENCRC [NONE]

field:CENSIZ [NONE]

field:CENLEN [NONE]

field:CENNAM [NONE]

field:CENEXT [NONE]

field:CENCOM [NONE]

field:CENDSK [NONE]

field:CENATT [NONE]

field:CENATX [NONE]

field:CENOFF [NONE]

field:ENDSUB [NONE]

field:ENDTOT [NONE]

field:ENDSIZ [NONE]

field:ENDOFF [NONE]

field:ENDCOM [NONE]

constructor:<init>(java.io.InputStream) [NONE]

  • ZipInputStream

    public ZipInputStream​(InputStream in)
    Creates a new ZIP input stream.

    The UTF-8 charset is used to decode the entry names.

    Parameters:
    in - the actual input stream

constructor:<init>(java.io.InputStream,java.nio.charset.Charset) [NONE]

  • ZipInputStream

    public ZipInputStream​(InputStream in,
                          Charset charset)
    Creates a new ZIP input stream.
    Parameters:
    in - the actual input stream
    charset - The charset to be used to decode the ZIP entry name (ignored if the language encoding bit of the ZIP entry's general purpose bit flag is set).
    Since:
    1.7

method:getNextEntry() [NONE]

  • getNextEntry

    public ZipEntry getNextEntry()
                          throws IOException
    
    Reads the next ZIP file entry and positions the stream at the beginning of the entry data.
    Returns:
    the next ZIP file entry, or null if there are no more entries
    Throws:
    ZipException - if a ZIP file error has occurred
    IOException - if an I/O error has occurred

method:closeEntry() [NONE]

  • closeEntry

    public void closeEntry()
                    throws IOException
    
    Closes the current ZIP entry and positions the stream for reading the next entry.
    Throws:
    ZipException - if a ZIP file error has occurred
    IOException - if an I/O error has occurred

method:available() [NONE]

  • available

    public int available()
                  throws IOException
    
    Returns 0 after EOF has reached for the current entry data, otherwise always return 1.

    Programs should not count on this method to return the actual number of bytes that could be read without blocking.

    Overrides:
    available in class InflaterInputStream
    Returns:
    1 before EOF and 0 after EOF has reached for current entry.
    Throws:
    IOException - if an I/O error occurs.

method:read(byte[],int,int) [NONE]

  • read

    public int read​(byte[] b,
                    int off,
                    int len)
             throws IOException
    
    Reads from the current ZIP entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.
    Overrides:
    read in class InflaterInputStream
    Parameters:
    b - the buffer into which the data is read
    off - the start offset in the destination array b
    len - the maximum number of bytes read
    Returns:
    the actual number of bytes read, or -1 if the end of the entry is reached
    Throws:
    NullPointerException - if b is null.
    IndexOutOfBoundsException - if off is negative, len is negative, or len is greater than b.length - off
    ZipException - if a ZIP file error has occurred
    IOException - if an I/O error has occurred
    See Also:
    FilterInputStream.in

method:skip(long) [CHANGED]

method:close() [NONE]

method:createZipEntry(java.lang.String) [NONE]

  • createZipEntry

    protected ZipEntry createZipEntry​(String name)
    Creates a new ZipEntry object for the specified entry name.
    Parameters:
    name - the ZIP file entry name
    Returns:
    the ZipEntry just created

© 2019 Oracle Corporation and/or its affiliates