Class ZlibCompression
- java.lang.Object
-
- net.schmizz.sshj.transport.compression.ZlibCompression
-
- All Implemented Interfaces:
Compression
- Direct Known Subclasses:
DelayedZlibCompression
public class ZlibCompression extends java.lang.Object implements Compression
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZlibCompression.Factory
Named factory for the ZLib Compression.-
Nested classes/interfaces inherited from interface net.schmizz.sshj.transport.compression.Compression
Compression.Mode
-
-
Constructor Summary
Constructors Constructor Description ZlibCompression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compress(Buffer buffer)
Compress the given buffer in place.void
init(Compression.Mode mode)
Initialize this object to either compress or uncompress data.boolean
isDelayed()
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 Detail
-
BUF_SIZE
private static final int BUF_SIZE
- See Also:
- Constant Field Values
-
tempBuf
private final byte[] tempBuf
-
deflater
private java.util.zip.Deflater deflater
-
inflater
private java.util.zip.Inflater inflater
-
-
Method Detail
-
init
public void init(Compression.Mode mode)
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
-
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
public void compress(Buffer buffer)
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
public void uncompress(Buffer from, Buffer to) throws TransportException
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
-
-