Class ZlibCompression
java.lang.Object
net.schmizz.sshj.transport.compression.ZlibCompression
- All Implemented Interfaces:
Compression
- Direct Known Subclasses:
DelayedZlibCompression
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNamed factory for the ZLib Compression.Nested classes/interfaces inherited from interface Compression
Compression.Mode -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCompress the given buffer in place.voidinit(Compression.Mode mode) Initialize this object to either compress or uncompress data.booleanDelayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.voiduncompress(Buffer from, Buffer to) Uncompress the data in a buffer into another buffer.
-
Field Details
-
BUF_SIZE
private static final int BUF_SIZE- See Also:
-
tempBuf
private final byte[] tempBuf -
deflater
-
inflater
-
-
Constructor Details
-
ZlibCompression
public ZlibCompression()
-
-
Method Details
-
init
Description copied from interface:CompressionInitialize this object to either compress or uncompress data. This method must be called prior to any calls to eithercompressoruncompress. Once the object has been initialized, only one ofcompressoruncompressmethod can be called.- Specified by:
initin interfaceCompression- Parameters:
mode-
-
isDelayed
public boolean isDelayed()Description copied from interface:CompressionDelayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.- Specified by:
isDelayedin interfaceCompression- Returns:
- if the compression is delayed after authentication or not
-
compress
Description copied from interface:CompressionCompress the given buffer in place.- Specified by:
compressin interfaceCompression- Parameters:
buffer- the buffer containing the data to compress s
-
uncompress
Description copied from interface:CompressionUncompress the data in a buffer into another buffer.- Specified by:
uncompressin interfaceCompression- Parameters:
from- the buffer containing the data to uncompressto- the buffer receiving the uncompressed data- Throws:
TransportException
-