📅  最后修改于: 2020-11-14 10:55:27             🧑  作者: Mango
java.util.zip.ZipOutputStream类实现了一个输出流过滤器,用于以ZIP文件格式写入文件。包括对压缩和未压缩条目的支持。
以下是java.util.zip.ZipOutputStream类的声明-
public class ZipOutputStream
extends DeflaterOutputStream
以下是java.util.zip.ZipOutputStream类的字段-
静态int CENATT
静态int CENATX
静态int CENCOM
静态int CENCRC
static int CENDSK
静态int CENEXT
静态int CENFLG
静态int CENHDR
静态int CENHOW
静态整数CENLEN
静态int CENNAM
静态int CENOFF
静态长CENSIG
静态int CENSIZ
静态int CENTIM
static int CENVEM
static int CENVER
static int DEFLATED-压缩(DEFLATED)条目的压缩方法。
静态int ENDCOM
静态int ENDHDR
静态int ENDOFF
静态长ENDSIG
静态整数ENDSIZ
静态int ENDSUB
静态int ENDTOT
静态int EXTCRC
静态诠释EXTHDR
静态整数EXTLEN
静态长EXTSIG
静态整数EXTSIZ
静态int LOCCRC
静态整数LOCEXT
静态int LOCFLG
静态int LOCHDR
静态int LOCHOW
静态整数LOCLEN
静态int LOCNAM
静态长LOCSIG
静态int LOCSIZ
静态整数LOCTIM
静态整数LOCVER
static int STORED-未压缩(STORED)条目的压缩方法。
Sr.No. | Constructor & Description |
---|---|
1 |
ZipOutputStream(OutputStream out) Creates a new ZIP output stream. |
2 |
ZipOutputStream(OutputStream out, Charset charset) Creates a new ZIP output stream. |
Sr.No. | Method & Description |
---|---|
1 | void close()
Closes the ZIP output stream as well as the stream being filtered. |
2 |
void closeEntry() Closes the current ZIP entry and positions the stream for writing the next entry. |
3 | void finish()
Finishes writing the contents of the ZIP output stream without closing the underlying stream. |
4 | void putNextEntry(ZipEntry e)
Begins writing a new ZIP file entry and positions the stream to the start of the entry data. |
5 | void setComment(String comment)
Sets the ZIP file comment. |
6 | void setLevel(int level)
Sets the compression level for subsequent entries which are DEFLATED. |
7 | void setMethod(int method)
Sets the default compression method for subsequent entries. |
8 | void write(byte[] b, int off, int len)
Writes an array of bytes to the current ZIP entry data. |
此类从以下类继承方法-