|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.ssh2.SSH2Compressor
This is the abstract base class for compressors which compress/uncompress the ssh stream.
Field Summary | |
static int |
COMPRESS_MODE
|
static int |
UNCOMPRESS_MODE
|
Constructor Summary | |
SSH2Compressor()
|
Method Summary | |
abstract void |
compress(SSH2DataBuffer data)
Compress a block of data. |
static SSH2Compressor |
getInstance(java.lang.String algorithm)
Get an instance of a compressor which implements the given algorithm. |
abstract void |
init(int mode,
int level)
Initialize the compressor. |
abstract long |
numOfCompressedBytes()
Get the total number of bytes compressed. |
abstract long |
numOfUncompressedBytes()
Get the total number of bytes uncompressed. |
abstract int |
uncompress(SSH2DataBuffer data,
int len)
Uncompress a block of data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int COMPRESS_MODE
public static final int UNCOMPRESS_MODE
Constructor Detail |
public SSH2Compressor()
Method Detail |
public static SSH2Compressor getInstance(java.lang.String algorithm) throws SSH2CompressionException
algorithm
- The compression algorithm to implement.
SSH2Compressor
or null
.
SSH2CompressionException
public abstract void init(int mode, int level)
mode
- Either COMPRESS_MODE
or
UNCOMPRESS_MODE
.level
- The level of compression. The exact meaning of this
is algorithm dependent.public abstract void compress(SSH2DataBuffer data) throws SSH2CompressionException
data
- The block of data to compress. The compressed data is left
in the same buffer.
SSH2CompressionException
public abstract int uncompress(SSH2DataBuffer data, int len) throws SSH2CompressionException
SSH2DataBuffer
given so this one has to be big enough
to fit the uncompressed data block.
data
- The block of data to uncompress.len
- How much data can be stored in the given buffer.
SSH2CompressionException
public abstract long numOfCompressedBytes()
public abstract long numOfUncompressedBytes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |