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 class
Named factory for the ZLib Compression.Nested classes/interfaces inherited from interface net.schmizz.sshj.transport.compression.Compression
Compression.Mode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Compress the given buffer in place.void
init
(Compression.Mode mode) Initialize this object to either compress or uncompress data.boolean
Delayed compression is an Open-SSH specific feature which informs both the client and server to not compress data before the session has been authenticated.void
uncompress
(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:Compression
Initialize this object to either compress or uncompress data. This method must be called prior to any calls to eithercompress
oruncompress
. Once the object has been initialized, only one ofcompress
oruncompress
method can be called.- Specified by:
init
in interfaceCompression
- Parameters:
mode
-
-
isDelayed
public boolean isDelayed()Description copied from interface:Compression
Delayed 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:
isDelayed
in interfaceCompression
- Returns:
- if the compression is delayed after authentication or not
-
compress
Description copied from interface:Compression
Compress the given buffer in place.- Specified by:
compress
in interfaceCompression
- Parameters:
buffer
- the buffer containing the data to compress s
-
uncompress
Description copied from interface:Compression
Uncompress the data in a buffer into another buffer.- Specified by:
uncompress
in interfaceCompression
- Parameters:
from
- the buffer containing the data to uncompressto
- the buffer receiving the uncompressed data- Throws:
TransportException
-