|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
com.myJava.file.archive.zip64.DeflaterOutputStream
public class DeflaterOutputStream
This class implements an output stream filter for compressing data in the "deflate" compression format. It is also used as the basis for other types of compression filters, such as GZIPOutputStream.
Deflater
Field Summary | |
---|---|
protected byte[] |
buf
Output buffer for writing compressed data. |
protected java.util.zip.Deflater |
def
Compressor for this stream. |
protected byte[] |
tmp
|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
DeflaterOutputStream(java.io.OutputStream out)
Creates a new output stream with a defaul compressor and buffer size. |
|
DeflaterOutputStream(java.io.OutputStream out,
java.util.zip.Deflater def)
Creates a new output stream with the specified compressor and a default buffer size. |
|
DeflaterOutputStream(java.io.OutputStream out,
java.util.zip.Deflater def,
int size)
Creates a new output stream with the specified compressor and buffer size. |
Method Summary | |
---|---|
void |
close()
Writes remaining compressed data to the output stream and closes the underlying stream. |
protected void |
deflate()
Writes next block of compressed data to the output stream. |
void |
finish()
Finishes writing compressed data to the output stream without closing the underlying stream. |
long |
getTotalIn()
|
long |
getTotalOut()
|
void |
resetDeflater()
|
void |
write(byte[] b,
int off,
int len)
Writes an array of bytes to the compressed output stream. |
void |
write(int b)
Writes a byte to the compressed output stream. |
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 |
---|
protected byte[] tmp
protected java.util.zip.Deflater def
protected byte[] buf
Constructor Detail |
---|
public DeflaterOutputStream(java.io.OutputStream out, java.util.zip.Deflater def, int size)
out
- the output streamdef
- the compressor ("deflater")size
- the output buffer size
java.lang.IllegalArgumentException
- if size is <= 0public DeflaterOutputStream(java.io.OutputStream out, java.util.zip.Deflater def)
out
- the output streamdef
- the compressor ("deflater")public DeflaterOutputStream(java.io.OutputStream out)
out
- the output streamMethod Detail |
---|
public long getTotalIn()
public long getTotalOut()
public void resetDeflater()
public void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- the byte to be written
java.io.IOException
- if an I/O error has occurredpublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- the data to be writtenoff
- the start offset of the datalen
- the length of the data
java.io.IOException
- if an I/O error has occurredpublic void finish() throws java.io.IOException
java.io.IOException
- if an I/O error has occurredpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.FilterOutputStream
java.io.IOException
- if an I/O error has occurredprotected void deflate() throws java.io.IOException
java.io.IOException
- if an I/O error has occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |