Class ZlibCompression

java.lang.Object
net.schmizz.sshj.transport.compression.ZlibCompression
All Implemented Interfaces:
Compression
Direct Known Subclasses:
DelayedZlibCompression

public class ZlibCompression extends Object implements Compression
  • Field Details

    • BUF_SIZE

      private static final int BUF_SIZE
      See Also:
    • tempBuf

      private final byte[] tempBuf
    • deflater

      private Deflater deflater
    • inflater

      private Inflater inflater
  • Constructor Details

    • ZlibCompression

      public ZlibCompression()
  • Method Details

    • 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 either compress or uncompress. Once the object has been initialized, only one of compress or uncompress method can be called.
      Specified by:
      init in interface Compression
      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 interface Compression
      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 interface Compression
      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 interface Compression
      Parameters:
      from - the buffer containing the data to uncompress
      to - the buffer receiving the uncompressed data
      Throws:
      TransportException