Interface SshCompression
- All Superinterfaces:
Component,SshComponent
- All Known Implementing Classes:
NoneCompression,OpenSSHZLibCompression,ZLibCompression
Compression interface which can be implemented to provide the SSH Transport Protocol with compression.
- Author:
- Lee David Painter
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] data, int start, int len) Compress a block of data.Get the algorithm name for this compression implementation.voidinit(int type, int level) Initialize the compression.byte[]uncompress(byte[] data, int start, int len) Uncompress a block of data.
-
Field Details
-
INFLATER
static final int INFLATERInflation mode- See Also:
-
DEFLATER
static final int DEFLATERDeflation mode- See Also:
-
-
Method Details
-
init
void init(int type, int level) Initialize the compression.- Parameters:
type- the mode of the compression, should be either INFLATER or DEFLATERlevel- the level of compression
-
compress
Compress a block of data.- Parameters:
data- the data to compressstart- the offset of the data to compresslen- the length of the data- Returns:
- the compressed data with any uncompressed data at the start remaining intact.
- Throws:
IOException
-
uncompress
Uncompress a block of data.- Parameters:
data- the data to uncompressstart- the offset of the data to uncompresslen- the length of the data- Returns:
- the uncompressed data with any data not compressed at the start remaining intact.
- Throws:
IOException
-
getAlgorithm
String getAlgorithm()Get the algorithm name for this compression implementation.- Specified by:
getAlgorithmin interfaceSshComponent- Returns:
- the algorithm name.
-