public class

ZlibCompression

extends Object
implements Compression
java.lang.Object
   ↳ net.schmizz.sshj.transport.compression.ZlibCompression
Known Direct Subclasses

Class Overview

ZLib based Compression.

Summary

Nested Classes
class ZlibCompression.Factory Named factory for the ZLib Compression. 
Constants
int BUF_SIZE
Fields
private ZStream stream
private final byte[] tempBuf
Public Constructors
ZlibCompression()
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface net.schmizz.sshj.transport.compression.Compression

Constants

private static final int BUF_SIZE

Constant Value: 4096 (0x00001000)

Fields

private ZStream stream

private final byte[] tempBuf

Public Constructors

public ZlibCompression ()

Public Methods

public void compress (Buffer buffer)

Compress the given buffer in place.

Parameters
buffer The buffer containing the data to compress s

public void init (Compression.Mode mode)

Initialize this object to either compress or uncompress data. This method must be called prior to any calls to either compress or uncompress. Once the object has been initialized, only one of compress or uncompress method can be called.

Parameters
mode

public 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.

Returns
  • if the compression is delayed after authentication or not

public void uncompress (Buffer from, Buffer to)

Uncompress the data in a buffer into another buffer.

Parameters
from The buffer containing the data to uncompress
to The buffer receiving the uncompressed data