Interface SshCompression

All Superinterfaces:
Component, SshComponent
All Known Implementing Classes:
NoneCompression, OpenSSHZLibCompression, ZLibCompression

public interface SshCompression extends SshComponent

Compression interface which can be implemented to provide the SSH Transport Protocol with compression.

Author:
Lee David Painter
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deflation mode
    static final int
    Inflation mode
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    compress(byte[] data, int start, int len)
    Compress a block of data.
    Get the algorithm name for this compression implementation.
    void
    init(int type, int level)
    Initialize the compression.
    byte[]
    uncompress(byte[] data, int start, int len)
    Uncompress a block of data.
  • Field Details

  • Method Details

    • init

      void init(int type, int level)
      Initialize the compression.
      Parameters:
      type - the mode of the compression, should be either INFLATER or DEFLATER
      level - the level of compression
    • compress

      byte[] compress(byte[] data, int start, int len) throws IOException
      Compress a block of data.
      Parameters:
      data - the data to compress
      start - the offset of the data to compress
      len - the length of the data
      Returns:
      the compressed data with any uncompressed data at the start remaining intact.
      Throws:
      IOException
    • uncompress

      byte[] uncompress(byte[] data, int start, int len) throws IOException
      Uncompress a block of data.
      Parameters:
      data - the data to uncompress
      start - the offset of the data to uncompress
      len - the length of the data
      Returns:
      the uncompressed data with any data not compressed at the start remaining intact.
      Throws:
      IOException
    • getAlgorithm

      String getAlgorithm()
      Get the algorithm name for this compression implementation.
      Specified by:
      getAlgorithm in interface SshComponent
      Returns:
      the algorithm name.