com.mindbright.ssh2
public abstract class SSH2Compressor extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
COMPRESS_MODE |
static int |
UNCOMPRESS_MODE |
Constructor and Description |
---|
SSH2Compressor() |
Modifier and Type | Method and Description |
---|---|
void |
authSucceeded()
Tell compression library that uiser has authenticated
|
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.
|
public static final int COMPRESS_MODE
public static final int UNCOMPRESS_MODE
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()
public void authSucceeded()