summaryrefslogtreecommitdiffstats
path: root/libjava/java/util/zip/DeflaterOutputStream.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-27 06:34:29 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-27 06:34:29 +0000
commit465be8f361bc020aa8907b4e55d1bb7c6505fa50 (patch)
tree49e3538d1fb5c0bd4b237abb3fee1421c2b585bd /libjava/java/util/zip/DeflaterOutputStream.java
parente2c08b7d1fe36e9b5a2aff9803ff11804985f4d8 (diff)
downloadppe42-gcc-465be8f361bc020aa8907b4e55d1bb7c6505fa50.tar.gz
ppe42-gcc-465be8f361bc020aa8907b4e55d1bb7c6505fa50.zip
2003-05-27 Michael Koch <konqueror@gmx.de>
* java/util/zip/Deflater.java (FILTERED): Merged documentation from classpath. * java/util/zip/DeflaterOutputStream.java (DeflaterOutputStream): Merged documentation and argument validity check from classpath. (deflate): Merged documentation from classpath. (finish): Likewise. * java/util/zip/Inflater.java (Inflater): Merged class documentation from classpath. (zstream): Reordered. (is_finished): Reordered. (dict_needed): Reordered. (Inflater): Reordered, merged documentation from classpath. (end): Likewise. (finalize): Merged documentation from classpath. (finished): Likewise. (getAdler): Likewise. (getRemaining): Likewise. (getTotalIn): Likewise. (getTotalOut): Likewise. (inflate): Likewise. (needsDictionary): Likewise. (needsInput): Likewise. (reset): Likewise. (setDictionary): Likewise. (setInput): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/zip/DeflaterOutputStream.java')
-rw-r--r--libjava/java/util/zip/DeflaterOutputStream.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/libjava/java/util/zip/DeflaterOutputStream.java b/libjava/java/util/zip/DeflaterOutputStream.java
index 755d8e71420..ff66b080f9e 100644
--- a/libjava/java/util/zip/DeflaterOutputStream.java
+++ b/libjava/java/util/zip/DeflaterOutputStream.java
@@ -56,6 +56,7 @@ import java.io.IOException;
* finishing the stream.
*
* @author Tom Tromey, Jochen Hoenicke
+ * @date Jan 11, 2001
*/
public class DeflaterOutputStream extends FilterOutputStream
{
@@ -65,6 +66,11 @@ public class DeflaterOutputStream extends FilterOutputStream
out.close();
}
+ /**
+ * Deflates everything in the def's input buffers. This will call
+ * <code>def.deflate()</code> until all bytes from the input buffers
+ * are processed.
+ */
protected void deflate () throws IOException
{
do
@@ -76,23 +82,49 @@ public class DeflaterOutputStream extends FilterOutputStream
while (! def.needsInput());
}
+ /**
+ * Creates a new DeflaterOutputStream with a default Deflater and
+ * default buffer size.
+ * @param out the output stream where deflated output should be written.
+ */
public DeflaterOutputStream (OutputStream out)
{
this (out, new Deflater (), 512);
}
+ /**
+ * Creates a new DeflaterOutputStream with the given Deflater and
+ * default buffer size.
+ * @param out the output stream where deflated output should be written.
+ * @param defl the underlying deflater.
+ */
public DeflaterOutputStream (OutputStream out, Deflater defl)
{
this (out, defl, 512);
}
+ /**
+ * Creates a new DeflaterOutputStream with the given Deflater and
+ * buffer size.
+ * @param out the output stream where deflated output should be written.
+ * @param defl the underlying deflater.
+ * @param bufsize the buffer size.
+ * @exception IllegalArgumentException if bufsize isn't positive.
+ */
public DeflaterOutputStream(OutputStream out, Deflater defl, int bufsize)
{
super (out);
+ if (bufsize <= 0)
+ throw new IllegalArgumentException("bufsize <= 0");
buf = new byte[bufsize];
def = defl;
}
+ /**
+ * Finishes the stream by calling finish() on the deflater. This
+ * was the only way to ensure that all bytes are flushed in Sun's
+ * JDK.
+ */
public void finish () throws IOException
{
if (inbufLength > 0)
OpenPOWER on IntegriCloud