|
JavaTM 2 Platform Standard Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--java.util.zip.DeflaterOutputStream
|
+--java.util.zip.ZipOutputStream
This class implements an output stream filter for writing files in the ZIP file format. Includes support for both compressed and uncompressed entries.
| Field Summary | |
static int |
DEFLATED
Compression method for compressed (DEFLATED) entries. |
static int |
STORED
Compression method for uncompressed (STORED) entries. |
| Fields inherited from class java.util.zip.DeflaterOutputStream |
buf,
def |
| Fields inherited from class java.io.FilterOutputStream |
out |
| 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 | |
ZipOutputStream(OutputStream out)
Creates a new ZIP output stream. |
|
| Method Summary | |
void |
close()
Closes the ZIP output stream as well as the stream being filtered. |
void |
closeEntry()
Closes the current ZIP entry and positions the stream for writing the next entry. |
void |
finish()
Finishes writing the contents of the ZIP output stream without closing the underlying stream. |
void |
putNextEntry(ZipEntry e)
Begins writing a new ZIP file entry and positions the stream to the start of the entry data. |
void |
setComment(String comment)
Sets the ZIP file comment. |
void |
setLevel(int level)
Sets the compression level for subsequent entries which are DEFLATED. |
void |
setMethod(int method)
Sets the default compression method for subsequent entries. |
void |
write(byte[] b,
int off,
int len)
Writes an array of bytes to the current ZIP entry data. |
| Methods inherited from class java.util.zip.DeflaterOutputStream |
deflate,
write |
| Methods inherited from class java.io.FilterOutputStream |
flush,
write |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int STORED
public static final int DEFLATED
| Constructor Detail |
public ZipOutputStream(OutputStream out)
out - the actual output stream| Method Detail |
public void setComment(String comment)
comment - the comment stringpublic void setMethod(int method)
method - the default compression methodpublic void setLevel(int level)
level - the compression level (0-9)
public void putNextEntry(ZipEntry e)
throws IOException
e - the ZIP entry to be written
public void closeEntry()
throws IOException
public void write(byte[] b,
int off,
int len)
throws IOException
b - the data to be writtenoff - the start offset in the datalen - the number of bytes that are written
public void finish()
throws IOException
public void close()
throws IOException
|
JavaTM 2 Platform Standard Edition |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||