|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
com.ning.compress.lzf.LZFOutputStream
public class LZFOutputStream
Decorator OutputStream
implementation that will compress
output using LZF compression algorithm.
Field Summary | |
---|---|
protected boolean |
_cfgFinishBlockOnFlush
Configuration setting that governs whether basic 'flush()' should first complete a block or not. |
protected byte[] |
_outputBuffer
|
protected OutputStream |
_outputStream
|
protected boolean |
_outputStreamClosed
Flag that indicates if we have already called '_outputStream.close()' (to avoid calling it multiple times) |
protected int |
_position
|
Constructor Summary | |
---|---|
LZFOutputStream(OutputStream outputStream)
|
Method Summary | |
---|---|
void |
close()
|
LZFOutputStream |
finishBlock()
Method that can be used to force completion of the current block, which means that all buffered data will be compressed into an LZF block. |
void |
flush()
|
boolean |
getFinishBlockOnFlush()
Accessor for checking whether call to "flush()" will first finish the current block or not |
OutputStream |
getUnderlyingOutputStream()
Method that can be used to find underlying OutputStream that
we write encoded LZF encoded data into, after compressing it. |
LZFOutputStream |
setFinishBlockOnFlush(boolean b)
Method for defining whether call to flush() will also complete
current block (similar to calling finishBlock() ) or not. |
void |
write(byte[] buffer,
int offset,
int length)
|
void |
write(int singleByte)
|
protected void |
writeCompressedBlock()
Compress and write the current block to the OutputStream |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final OutputStream _outputStream
protected byte[] _outputBuffer
protected int _position
protected boolean _cfgFinishBlockOnFlush
Default value is 'true'
protected boolean _outputStreamClosed
Constructor Detail |
---|
public LZFOutputStream(OutputStream outputStream)
Method Detail |
---|
public LZFOutputStream setFinishBlockOnFlush(boolean b)
flush()
will also complete
current block (similar to calling finishBlock()
) or not.
public void write(int singleByte) throws IOException
write
in class OutputStream
IOException
public void write(byte[] buffer, int offset, int length) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public OutputStream getUnderlyingOutputStream()
OutputStream
that
we write encoded LZF encoded data into, after compressing it.
Will never return null; although underlying stream may be closed
(if this stream has been closed).
public boolean getFinishBlockOnFlush()
public LZFOutputStream finishBlock() throws IOException
IOException
protected void writeCompressedBlock() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |