Class CompressionZlib

    • Field Detail

      • tmpbuf

        private byte[] tmpbuf
      • compresser

        private java.util.zip.Deflater compresser
      • decompresser

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

      • CompressionZlib

        public CompressionZlib()
        Create a new instance of a ZLib base compression
      • CompressionZlib

        protected CompressionZlib​(java.lang.String name)
    • Method Detail

      • isDelayed

        public boolean isDelayed()
        Description copied from interface: CompressionInformation
        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
      • init

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

        public void compress​(Buffer buffer)
                      throws java.io.IOException
        Description copied from interface: Compression
        Compress the given buffer in place.
        Parameters:
        buffer - the buffer containing the data to compress
        Throws:
        java.io.IOException - if an error occurs
      • uncompress

        public void uncompress​(Buffer from,
                               Buffer to)
                        throws java.io.IOException
        Description copied from interface: Compression
        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:
        java.io.IOException - if an error occurs