Package com.sshtools.common.zlib
Class ZLibCompression
java.lang.Object
com.sshtools.common.zlib.ZLibCompression
- All Implemented Interfaces:
Component,SshComponent,SshCompression
- Direct Known Subclasses:
OpenSSHZLibCompression
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.sshtools.common.ssh.compression.SshCompression
DEFLATER, INFLATER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]compress(byte[] buf, 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[] buffer, int start, int length) Uncompress a block of data.
-
Constructor Details
-
ZLibCompression
public ZLibCompression()
-
-
Method Details
-
getAlgorithm
Description copied from interface:SshCompressionGet the algorithm name for this compression implementation.- Specified by:
getAlgorithmin interfaceSshComponent- Specified by:
getAlgorithmin interfaceSshCompression- Returns:
- the algorithm name.
-
init
public void init(int type, int level) Description copied from interface:SshCompressionInitialize the compression.- Specified by:
initin interfaceSshCompression- Parameters:
type- the mode of the compression, should be either INFLATER or DEFLATERlevel- the level of compression
-
compress
Description copied from interface:SshCompressionCompress a block of data.- Specified by:
compressin interfaceSshCompression- Parameters:
buf- 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
Description copied from interface:SshCompressionUncompress a block of data.- Specified by:
uncompressin interfaceSshCompression- Parameters:
buffer- the data to uncompressstart- the offset of the data to uncompresslength- the length of the data- Returns:
- the uncompressed data with any data not compressed at the start remaining intact.
- Throws:
IOException
-