|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mindbright.ssh2.SSH2Compressor
com.mindbright.ssh2.SSH2CompressorZLib
Implements the zlib compression algorithm as described in the ssh protocol draft. It uses the jzlib provided by JCraft to handle the actual compression/uncompression.
| Field Summary |
| Fields inherited from class com.mindbright.ssh2.SSH2Compressor |
COMPRESS_MODE, UNCOMPRESS_MODE |
| Constructor Summary | |
SSH2CompressorZLib()
|
|
| Method Summary | |
void |
compress(SSH2DataBuffer data)
Compress a block of data. |
void |
init(int mode,
int level)
Initialize the compressor. |
long |
numOfCompressedBytes()
Get the total number of bytes compressed. |
long |
numOfUncompressedBytes()
Get the total number of bytes uncompressed. |
int |
uncompress(SSH2DataBuffer data,
int len)
Uncompress a block of data. |
| Methods inherited from class com.mindbright.ssh2.SSH2Compressor |
authSucceeded, getInstance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SSH2CompressorZLib()
| Method Detail |
public void init(int mode,
int level)
SSH2Compressor
init in class SSH2Compressormode - Either COMPRESS_MODE or
UNCOMPRESS_MODE.level - The level of compression. The exact meaning of this
is algorithm dependent.
public void compress(SSH2DataBuffer data)
throws SSH2CompressionException
SSH2Compressor
compress in class SSH2Compressordata - The block of data to compress. The compressed data is left
in the same buffer.
SSH2CompressionException
public int uncompress(SSH2DataBuffer data,
int len)
throws SSH2CompressionException
SSH2CompressorSSH2DataBuffer given so this one has to be big enough
to fit the uncompressed data block.
uncompress in class SSH2Compressordata - The block of data to uncompress.len - How much data can be stored in the given buffer.
SSH2CompressionExceptionpublic long numOfCompressedBytes()
SSH2Compressor
numOfCompressedBytes in class SSH2Compressorpublic long numOfUncompressedBytes()
SSH2Compressor
numOfUncompressedBytes in class SSH2Compressor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||