<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.util.zip.ZipOutputStream
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.zip.html">This Package</a>  <a href="java.util.zip.ZipInputStream.html#_top_">Previous</a>  <a href="Package-java.util.zip.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.util.zip.ZipOutputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.OutputStream.html#_top_">java.io.OutputStream</a>
           |
           +----<a href="java.io.FilterOutputStream.html#_top_">java.io.FilterOutputStream</a>
                   |
                   +----<a href="java.util.zip.DeflaterOutputStream.html#_top_">java.util.zip.DeflaterOutputStream</a>
                           |
                           +----java.util.zip.ZipOutputStream
</pre>
<hr>
<dl>
  <dt> public class <b>ZipOutputStream</b>
  <dt> extends <a href="java.util.zip.DeflaterOutputStream.html#_top_">DeflaterOutputStream</a>
  <dt> implements ZipConstants
</dl>
This class implements an output stream filter for writing files in the
 ZIP file format. Includes support for both compressed and uncompressed
 entries.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#DEFLATED"><b>DEFLATED</b></a>
  <dd>  Compression method for compressed (DEFLATED) entries.
  <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#STORED"><b>STORED</b></a>
  <dd>  Compression method for uncompressed (STORED) entries.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#ZipOutputStream(java.io.OutputStream)"><b>ZipOutputStream</b></a>(OutputStream)
  <dd>  Creates a new ZIP output stream.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#close()"><b>close</b></a>()
  <dd>  Closes the ZIP output stream as well as the stream being filtered.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#closeEntry()"><b>closeEntry</b></a>()
  <dd>  Closes the current ZIP entry and positions the stream for writing
 the next entry.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#finish()"><b>finish</b></a>()
  <dd>  Finishes writing the contents of the ZIP output stream without closing
 the underlying stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#putNextEntry(java.util.zip.ZipEntry)"><b>putNextEntry</b></a>(ZipEntry)
  <dd>  Begins writing a new ZIP file entry and positions the stream to the
 start of the entry data.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setComment(java.lang.String)"><b>setComment</b></a>(String)
  <dd>  Sets the ZIP file comment.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setLevel(int)"><b>setLevel</b></a>(int)
  <dd>  Sets the compression level for subsequent entries which are DEFLATED.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setMethod(int)"><b>setMethod</b></a>(int)
  <dd>  Sets the default compression method for subsequent entries.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#write(byte[], int, int)"><b>write</b></a>(byte[], int, int)
  <dd>  Writes an array of bytes to the current ZIP entry data.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="STORED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>STORED</b>
<pre>
 public static final int STORED
</pre>
<dl>
  <dd> Compression method for uncompressed (STORED) entries.<p>
</dl>
<a name="DEFLATED"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>DEFLATED</b>
<pre>
 public static final int DEFLATED
</pre>
<dl>
  <dd> Compression method for compressed (DEFLATED) entries.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="ZipOutputStream"></a>
<a name="ZipOutputStream(java.io.OutputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>ZipOutputStream</b>
<pre>
 public ZipOutputStream(<a href="java.io.OutputStream.html#_top_">OutputStream</a> out)
</pre>
<dl>
  <dd> Creates a new ZIP output stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> out - the actual output stream
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setComment(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setComment"><b>setComment</b></a>
<pre>
 public void setComment(<a href="java.lang.String.html#_top_">String</a> comment)
</pre>
<dl>
  <dd> Sets the ZIP file comment.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comment - the comment string
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the length of the specified
		  ZIP file comment is greater than 0xFFFF bytes
  </dl></dd>
</dl>
<a name="setMethod(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setMethod"><b>setMethod</b></a>
<pre>
 public void setMethod(int method)
</pre>
<dl>
  <dd> 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.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> method - the default compression method
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the specified compression method
		  is invalid
  </dl></dd>
</dl>
<a name="setLevel(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setLevel"><b>setLevel</b></a>
<pre>
 public void setLevel(int level)
</pre>
<dl>
  <dd> Sets the compression level for subsequent entries which are DEFLATED.
 The default setting is DEFAULT_COMPRESSION.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> level - the compression level (0-9)
    <dt> <b>Throws:</b> <a href="java.lang.IllegalArgumentException.html#_top_">IllegalArgumentException</a>
    <dd> if the compression level is invalid
  </dl></dd>
</dl>
<a name="putNextEntry(java.util.zip.ZipEntry)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="putNextEntry"><b>putNextEntry</b></a>
<pre>
 public void putNextEntry(<a href="java.util.zip.ZipEntry.html#_top_">ZipEntry</a> e) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> 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.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - the ZIP entry to be written
    <dt> <b>Throws:</b> <a href="java.util.zip.ZipException.html#_top_">ZipException</a>
    <dd> if a ZIP format error has occurred
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error has occurred
  </dl></dd>
</dl>
<a name="closeEntry()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="closeEntry"><b>closeEntry</b></a>
<pre>
 public void closeEntry() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Closes the current ZIP entry and positions the stream for writing
 the next entry.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.util.zip.ZipException.html#_top_">ZipException</a>
    <dd> if a ZIP format error has occurred
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error has occurred
  </dl></dd>
</dl>
<a name="write(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="write"><b>write</b></a>
<pre>
 public synchronized void write(byte b[],
                                int off,
                                int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Writes an array of bytes to the current ZIP entry data. This method
 will block until all the bytes are written.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the data to be written
    <dd> off - the start offset in the data
    <dd> len - the number of bytes that are written
    <dt> <b>Throws:</b> <a href="java.util.zip.ZipException.html#_top_">ZipException</a>
    <dd> if a ZIP file error has occurred
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error has occurred
    <dt> <b>Overrides:</b>
    <dd> <a href="java.util.zip.DeflaterOutputStream.html#write(byte[], int, int)">write</a> in class <a href="java.util.zip.DeflaterOutputStream.html#_top_">DeflaterOutputStream</a>
  </dl></dd>
</dl>
<a name="finish()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="finish"><b>finish</b></a>
<pre>
 public void finish() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> 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.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.util.zip.ZipException.html#_top_">ZipException</a>
    <dd> if a ZIP file error has occurred
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O exception has occurred
    <dt> <b>Overrides:</b>
    <dd> <a href="java.util.zip.DeflaterOutputStream.html#finish()">finish</a> in class <a href="java.util.zip.DeflaterOutputStream.html#_top_">DeflaterOutputStream</a>
  </dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
 public void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Closes the ZIP output stream as well as the stream being filtered.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.util.zip.ZipException.html#_top_">ZipException</a>
    <dd> if a ZIP file error has occurred
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error has occurred
    <dt> <b>Overrides:</b>
    <dd> <a href="java.util.zip.DeflaterOutputStream.html#close()">close</a> in class <a href="java.util.zip.DeflaterOutputStream.html#_top_">DeflaterOutputStream</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.util.zip.html">This Package</a>  <a href="java.util.zip.ZipInputStream.html#_top_">Previous</a>  <a href="Package-java.util.zip.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
