public class BlockCompressorStream extends CompressorStream
CompressorStream which works
with 'block-based' based compression algorithms, as opposed to
'stream-based' compression algorithms.
It should be noted that this wrapper does not guarantee that blocks will
be sized for the compressor. If the
Compressor requires buffering to
effect meaningful compression, it is responsible for it.buffer, closed, compressorout| 构造器和说明 |
|---|
BlockCompressorStream(OutputStream out,
Compressor compressor)
Create a
BlockCompressorStream with given output-stream and
compressor. |
BlockCompressorStream(OutputStream out,
Compressor compressor,
int bufferSize,
int compressionOverhead)
Create a
BlockCompressorStream. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
compress() |
void |
finish()
Finishes writing compressed data to the output stream
without closing the underlying stream.
|
void |
write(byte[] b,
int off,
int len)
Write the data provided to the compression codec, compressing no more
than the buffer size less the compression overhead as specified during
construction for each block.
|
close, resetState, writeflushwritepublic BlockCompressorStream(OutputStream out, Compressor compressor, int bufferSize, int compressionOverhead)
BlockCompressorStream.out - streamcompressor - compressor to be usedbufferSize - size of buffercompressionOverhead - maximum 'overhead' of the compression
algorithm with given bufferSizepublic BlockCompressorStream(OutputStream out, Compressor compressor)
BlockCompressorStream with given output-stream and
compressor.
Use default of 512 as bufferSize and compressionOverhead of
(1% of bufferSize + 12 bytes) = 18 bytes (zlib algorithm).out - streamcompressor - compressor to be usedpublic void write(byte[] b,
int off,
int len)
throws IOException
write 在类中 CompressorStreamIOExceptionpublic void finish()
throws IOException
CompressionOutputStreamfinish 在类中 CompressorStreamIOExceptionprotected void compress()
throws IOException
compress 在类中 CompressorStreamIOExceptionCopyright © 2009 The Apache Software Foundation