com.maverick.ssh.components
Interface SshCompression

All Superinterfaces:
SshComponent
All Known Implementing Classes:
NoneCompression

public interface SshCompression
extends SshComponent

Compression interface which can be implemented to provide the SSH Transport Protocol with compression.

Author:
Lee David Painter

Field Summary
static int DEFLATER
          Deflation mode
static int INFLATER
          Inflation mode
 
Method Summary
 byte[] compress(byte[] data, int start, int len)
          Compress a block of data.
 String getName()
          Get the algorithm name for this compression implementation.
 void init(int type, int level)
          Initialize the compression.
 byte[] uncompress(byte[] data, int start, int len)
          Uncompress a block of data.
 

Field Detail

INFLATER

static final int INFLATER
Inflation mode

See Also:
Constant Field Values

DEFLATER

static final int DEFLATER
Deflation mode

See Also:
Constant Field Values
Method Detail

init

void init(int type,
          int level)
Initialize the compression.

Parameters:
type - the mode of the compression, should be either INFLATER or DEFLATER
level - the level of compression

compress

byte[] compress(byte[] data,
                int start,
                int len)
                throws IOException
Compress a block of data.

Parameters:
data - the data to compress
start - the offset of the data to compress
len - the length of the data
Returns:
the compressed data with any uncompressed data at the start remaining intact.
Throws:
IOException

uncompress

byte[] uncompress(byte[] data,
                  int start,
                  int len)
                  throws IOException
Uncompress a block of data.

Parameters:
data - the data to uncompress
start - the offset of the data to uncompress
len - the length of the data
Returns:
the uncompressed data with any data not compressed at the start remaining intact.
Throws:
IOException

getName

String getName()
Get the algorithm name for this compression implementation.

Specified by:
getName in interface SshComponent
Returns:
the algorithm name.


Copyright © 2013. All Rights Reserved.