Interface Compression

    • Method Detail

      • 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