Package Summary  Overview Summary

class:ZipOutputStream [NONE]

field:STORED [NONE]

  • STORED

    public static final int STORED
    Compression method for uncompressed (STORED) entries.
    See Also:
    Constant Field Values

field:DEFLATED [NONE]

  • DEFLATED

    public static final int DEFLATED
    Compression method for compressed (DEFLATED) entries.
    See Also:
    Constant Field Values

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.OutputStream) [NONE]

  • ZipOutputStream

    public ZipOutputStream​(OutputStream out)
    Creates a new ZIP output stream.

    The UTF-8 charset is used to encode the entry names and comments.

    Parameters:
    out - the actual output stream

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

  • ZipOutputStream

    public ZipOutputStream​(OutputStream out,
                           Charset charset)
    Creates a new ZIP output stream.
    Parameters:
    out - the actual output stream
    charset - the charset to be used to encode the entry names and comments
    Since:
    1.7

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

  • setComment

    public void setComment​(String comment)
    Sets the ZIP file comment.
    Parameters:
    comment - the comment string
    Throws:
    IllegalArgumentException - if the length of the specified ZIP file comment is greater than 0xFFFF bytes

method:setMethod(int) [NONE]

  • setMethod

    public void setMethod​(int method)
    Sets the default compression method for subsequent entries. This default will be used whenever the compression method is not specified for an individual ZIP file entry, and is initially set to DEFLATED.
    Parameters:
    method - the default compression method
    Throws:
    IllegalArgumentException - if the specified compression method is invalid

method:setLevel(int) [NONE]

  • setLevel

    public void setLevel​(int level)
    Sets the compression level for subsequent entries which are DEFLATED. The default setting is DEFAULT_COMPRESSION.
    Parameters:
    level - the compression level (0-9)
    Throws:
    IllegalArgumentException - if the compression level is invalid

method:putNextEntry(java.util.zip.ZipEntry) [NONE]

  • putNextEntry

    public void putNextEntry​(ZipEntry e)
                      throws IOException
    
    Begins writing a new ZIP file entry and positions the stream to the start of the entry data. Closes the current entry if still active. The default compression method will be used if no compression method was specified for the entry, and the current time will be used if the entry has no set modification time.
    Parameters:
    e - the ZIP entry to be written
    Throws:
    ZipException - if a ZIP format 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 writing the next entry.
    Throws:
    ZipException - if a ZIP format error has occurred
    IOException - if an I/O error has occurred

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

  • write

    public void write​(byte[] b,
                      int off,
                      int len)
               throws IOException
    
    Writes an array of bytes to the current ZIP entry data. This method will block until all the bytes are written.
    Overrides:
    write in class DeflaterOutputStream
    Parameters:
    b - the data to be written
    off - the start offset in the data
    len - the number of bytes that are written
    Throws:
    ZipException - if a ZIP file error has occurred
    IOException - if an I/O error has occurred
    See Also:
    FilterOutputStream.write(int)

method:finish() [NONE]

  • finish

    public void finish()
                throws IOException
    
    Finishes writing the contents of the ZIP output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
    Overrides:
    finish in class DeflaterOutputStream
    Throws:
    ZipException - if a ZIP file error has occurred
    IOException - if an I/O exception has occurred

method:close() [NONE]

© 2019 Oracle Corporation and/or its affiliates