Interface Compression

All Superinterfaces:
CompressionInformation, NamedResource
All Known Implementing Classes:
BaseCompression, CompressionDelayedZlib, CompressionNone, CompressionZlib

public interface Compression extends CompressionInformation
Interface used to compress the stream of data between the SSH server and clients.
  • Method Details

    • init

      void init(Compression.Type type, int level)
      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 methods can be called.
      Parameters:
      type - compression type
      level - compression level
    • compress

      void compress(Buffer buffer) throws IOException
      Compress the given buffer in place.
      Parameters:
      buffer - the buffer containing the data to compress
      Throws:
      IOException - if an error occurs
    • uncompress

      void uncompress(Buffer from, Buffer to) throws IOException
      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
      Throws:
      IOException - if an error occurs