1 *java.util.zip.ZipOutputStream* *ZipOutputStream* This class implements an outpu
3 public class ZipOutputStream
4 extends |java.util.zip.DeflaterOutputStream|
5 implements |java.util.zip.ZipConstants|
7 |java.util.zip.ZipOutputStream_Description|
8 |java.util.zip.ZipOutputStream_Fields|
9 |java.util.zip.ZipOutputStream_Constructors|
10 |java.util.zip.ZipOutputStream_Methods|
12 ================================================================================
14 *java.util.zip.ZipOutputStream_Fields*
15 |int_java.util.zip.ZipOutputStream.DEFLATED|
16 |int_java.util.zip.ZipOutputStream.STORED|
18 *java.util.zip.ZipOutputStream_Constructors*
19 |java.util.zip.ZipOutputStream(OutputStream)|Creates a new ZIP output stream.
21 *java.util.zip.ZipOutputStream_Methods*
22 |java.util.zip.ZipOutputStream.close()|Closes the ZIP output stream as well as
23 |java.util.zip.ZipOutputStream.closeEntry()|Closes the current ZIP entry and po
24 |java.util.zip.ZipOutputStream.finish()|Finishes writing the contents of the ZI
25 |java.util.zip.ZipOutputStream.putNextEntry(ZipEntry)|Begins writing a new ZIP
26 |java.util.zip.ZipOutputStream.setComment(String)|Sets the ZIP file comment.
27 |java.util.zip.ZipOutputStream.setLevel(int)|Sets the compression level for sub
28 |java.util.zip.ZipOutputStream.setMethod(int)|Sets the default compression meth
29 |java.util.zip.ZipOutputStream.write(byte[],int,int)|Writes an array of bytes t
31 *java.util.zip.ZipOutputStream_Description*
33 This class implements an output stream filter for writing files in the ZIP file
34 format. Includes support for both compressed and uncompressed entries.
37 *int_java.util.zip.ZipOutputStream.DEFLATED*
39 This class implements an output stream filter for writing files in the ZIP file
40 format. Includes support for both compressed and uncompressed entries.
43 *int_java.util.zip.ZipOutputStream.STORED*
45 This class implements an output stream filter for writing files in the ZIP file
46 format. Includes support for both compressed and uncompressed entries.
50 *java.util.zip.ZipOutputStream(OutputStream)*
52 public ZipOutputStream(java.io.OutputStream out)
54 Creates a new ZIP output stream.
56 out - the actual output stream
58 *java.util.zip.ZipOutputStream.close()*
61 throws |java.io.IOException|
63 Closes the ZIP output stream as well as the stream being filtered.
66 *java.util.zip.ZipOutputStream.closeEntry()*
68 public void closeEntry()
69 throws |java.io.IOException|
71 Closes the current ZIP entry and positions the stream for writing the next
75 *java.util.zip.ZipOutputStream.finish()*
78 throws |java.io.IOException|
80 Finishes writing the contents of the ZIP output stream without closing the
81 underlying stream. Use this method when applying multiple filters in succession
82 to the same output stream.
85 *java.util.zip.ZipOutputStream.putNextEntry(ZipEntry)*
87 public void putNextEntry(java.util.zip.ZipEntry e)
88 throws |java.io.IOException|
90 Begins writing a new ZIP file entry and positions the stream to the start of
91 the entry data. Closes the current entry if still active. The default
92 compression method will be used if no compression method was specified for the
93 entry, and the current time will be used if the entry has no set modification
96 e - the ZIP entry to be written
98 *java.util.zip.ZipOutputStream.setComment(String)*
100 public void setComment(java.lang.String comment)
102 Sets the ZIP file comment.
104 comment - the comment string
106 *java.util.zip.ZipOutputStream.setLevel(int)*
108 public void setLevel(int level)
110 Sets the compression level for subsequent entries which are DEFLATED. The
111 default setting is DEFAULT_COMPRESSION.
113 level - the compression level (0-9)
115 *java.util.zip.ZipOutputStream.setMethod(int)*
117 public void setMethod(int method)
119 Sets the default compression method for subsequent entries. This default will
120 be used whenever the compression method is not specified for an individual ZIP
121 file entry, and is initially set to DEFLATED.
123 method - the default compression method
125 *java.util.zip.ZipOutputStream.write(byte[],int,int)*
127 public synchronized void write(
131 throws |java.io.IOException|
133 Writes an array of bytes to the current ZIP entry data. This method will block
134 until all the bytes are written.
136 b - the data to be written
137 off - the start offset in the data
138 len - the number of bytes that are written