public final class ConitnuousGzipOutputStream
extends java.io.OutputStream
GZIPOutputStream
of the standard JDK to implement
a continuous buffered output stream for data compression. This stream does
not need you to invoke a finish() method as the GZIPOutputStream
do.
This stream is usable just as any other stream decorator with the basic
methods write(int)
, flush()
, close()
and so on. To
reach its goal, this class buffers the data bytes and compresses them per
blocks.Constructor and Description |
---|
ConitnuousGzipOutputStream(java.io.OutputStream output,
int bufferSize)
Build a new compression stream with the specified buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
int |
getBufferSize() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public ConitnuousGzipOutputStream(java.io.OutputStream output, int bufferSize)
output
- the underlying output streambufferSize
- the size of the compression windowpublic int getBufferSize()
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException