com.mindbright.ssh2
Class SSH2CompressorZLibOpenSSH

java.lang.Object
  extended by com.mindbright.ssh2.SSH2Compressor
      extended by com.mindbright.ssh2.SSH2CompressorZLib
          extended by com.mindbright.ssh2.SSH2CompressorZLibOpenSSH

public class SSH2CompressorZLibOpenSSH
extends SSH2CompressorZLib

Implements the zlib@openssh.com compression algorithm a implemented in OpenSSH 4.2p1. This is just zlib but the compression starts when the user has authenitcated successfully.


Field Summary
protected  boolean authenticated
           
 
Fields inherited from class com.mindbright.ssh2.SSH2Compressor
COMPRESS_MODE, UNCOMPRESS_MODE
 
Constructor Summary
SSH2CompressorZLibOpenSSH()
           
 
Method Summary
 void authSucceeded()
          Tell compression library that uiser has authenticated
 void compress(SSH2DataBuffer data)
          Compress a block of data.
 void init(int mode, int level)
          Initialize the compressor.
 int uncompress(SSH2DataBuffer data, int len)
          Uncompress a block of data.
 
Methods inherited from class com.mindbright.ssh2.SSH2CompressorZLib
numOfCompressedBytes, numOfUncompressedBytes
 
Methods inherited from class com.mindbright.ssh2.SSH2Compressor
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authenticated

protected boolean authenticated
Constructor Detail

SSH2CompressorZLibOpenSSH

public SSH2CompressorZLibOpenSSH()
Method Detail

init

public void init(int mode,
                 int level)
Description copied from class: SSH2Compressor
Initialize the compressor. Sets the mode (compress or uncompress) as well as the desired level of compression.

Overrides:
init in class SSH2CompressorZLib
Parameters:
mode - Either COMPRESS_MODE or UNCOMPRESS_MODE.
level - The level of compression. The exact meaning of this is algorithm dependent.

compress

public void compress(SSH2DataBuffer data)
              throws SSH2CompressionException
Description copied from class: SSH2Compressor
Compress a block of data.

Overrides:
compress in class SSH2CompressorZLib
Parameters:
data - The block of data to compress. The compressed data is left in the same buffer.
Throws:
SSH2CompressionException

uncompress

public int uncompress(SSH2DataBuffer data,
                      int len)
               throws SSH2CompressionException
Description copied from class: SSH2Compressor
Uncompress a block of data. The uncompressed data is stored in the SSH2DataBuffer given so this one has to be big enough to fit the uncompressed data block.

Overrides:
uncompress in class SSH2CompressorZLib
Parameters:
data - The block of data to uncompress.
len - How much data can be stored in the given buffer.
Throws:
SSH2CompressionException

authSucceeded

public void authSucceeded()
Description copied from class: SSH2Compressor
Tell compression library that uiser has authenticated

Overrides:
authSucceeded in class SSH2Compressor