Class ZlibCompression

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ZlibCompression.Factory
      Named factory for the ZLib Compression.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int BUF_SIZE  
      private java.util.zip.Deflater deflater  
      private java.util.zip.Inflater inflater  
      private byte[] tempBuf  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • tempBuf

        private final byte[] tempBuf
      • deflater

        private java.util.zip.Deflater deflater
      • inflater

        private java.util.zip.Inflater inflater
    • Constructor Detail

      • ZlibCompression

        public ZlibCompression()
    • 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 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
      • 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