java.util.zip
public class ZipOutputStream extends DeflaterOutputStream implements ZipConstants
Field Summary | |
---|---|
static int | DEFLATED
Compression method. |
static int | STORED
Compression method. |
Constructor Summary | |
---|---|
ZipOutputStream(OutputStream out)
Creates a new Zip output stream, writing a zip archive. |
Method Summary | |
---|---|
void | closeEntry()
Closes the current entry. |
void | finish()
Finishes the stream. |
void | putNextEntry(ZipEntry entry)
Starts a new Zip entry. |
void | setComment(String comment)
Set the zip file comment. |
void | setLevel(int level)
Sets default compression level. |
void | setMethod(int method)
Sets default compression method. |
void | write(byte[] b, int off, int len)
Writes the given buffer to the current entry. |
Parameters: out the output stream to which the zip archive is written.
Throws: IOException if an I/O error occured. ZipException if no entry is active.
Throws: IOException if an I/O error occured.
Parameters: entry the entry.
Throws: IOException if an I/O error occured. ZipException if stream was finished.
Parameters: comment the comment.
Throws: IllegalArgumentException if encoding of comment is longer than 0xffff bytes.
Throws: IllegalArgumentException if level is not supported.
See Also: Deflater
Parameters: method the method.
Throws: IllegalArgumentException if method is not supported.
Throws: IOException if an I/O error occured. ZipException if no entry is active.