|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
public class DeflaterOutputStream
The DeflaterOutputStream class implements a stream filter for the writing of compressed data to a stream. Compression is performed by an instance of Deflater.
| Field Summary | |
|---|---|
protected byte[] |
buf
|
(package private) static int |
BUF_SIZE
|
protected Deflater |
def
|
(package private) boolean |
done
|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
DeflaterOutputStream(OutputStream os)
Constructs a new DeflaterOutputStream instance using os as the underlying stream. |
|
DeflaterOutputStream(OutputStream os,
Deflater def)
Constructs a new DeflaterOutputStream instance using os as the underlying stream. |
|
DeflaterOutputStream(OutputStream os,
Deflater def,
int bsize)
Constructs a new DeflaterOutputStream instance using os as the underlying stream. |
|
| Method Summary | |
|---|---|
void |
close()
Writes any unwritten compressed data to the underlying stream, the closes all underlying streams. |
protected void |
deflate()
Compress the data in the input buffer and write it to the underlying stream. |
void |
finish()
Write any unwritten data to the underlying stream. |
void |
write(byte[] buffer,
int off,
int nbytes)
Compress nbytes of data from buf starting at off and write it to the underlying stream. |
void |
write(int i)
Writes the specified byte oneByte to this
FilterOutputStream. |
| 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 |
|---|
static final int BUF_SIZE
protected byte[] buf
protected Deflater def
boolean done
| Constructor Detail |
|---|
public DeflaterOutputStream(OutputStream os,
Deflater def)
os - OutputStream to receive compressed datadef - Deflater to perform compressionpublic DeflaterOutputStream(OutputStream os)
os - OutputStream to receive compressed data
public DeflaterOutputStream(OutputStream os,
Deflater def,
int bsize)
os - OutputStream to receive compressed datadef - Deflater to perform compressionbsize - size of internal compression buffer| Method Detail |
|---|
protected void deflate()
throws IOException
IOException - If an error occurs during deflation.
public void close()
throws IOException
close in interface Closeableclose in class FilterOutputStreamIOException - If an error occurs during close.
public void finish()
throws IOException
IOException - If an error occurs.
public void write(int i)
throws IOException
FilterOutputStreamoneByte to this
FilterOutputStream. Only the low order byte of oneByte is
written. This implementation writes the byte to the target OutputStream.
write in class FilterOutputStreami - the byte to be written
IOException - If an error occurs attempting to write to this
FilterOutputStream.
public void write(byte[] buffer,
int off,
int nbytes)
throws IOException
write in class FilterOutputStreambuffer - Buffer of data to compressoff - offset in buffer to extract data fromnbytes - Number of bytes of data to compress and write
IOException - If an error occurs during writing.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||