Class DirectDecompress

    • Method Detail

      • decompress

        public static DirectDecompress decompress​(byte[] compressedData)
                                           throws java.io.IOException
        Initiate direct decompression of data
        Parameters:
        compressedData - Compressed data as Byte Array
        Returns:
        DirectDecompress Instance
        Throws:
        java.io.IOException - In case of some error during decompression
      • decompress

        public static DirectDecompress decompress​(byte[] compressedData,
                                                  int maxOutputSize)
                                           throws java.io.IOException
        Initiate direct decompression of data, failing if the decompressed output would exceed maxOutputSize bytes. Use to mitigate decompression bombs.
        Parameters:
        compressedData - Compressed data as Byte Array
        maxOutputSize - cap on total decompressed bytes; 0 for no cap
        Returns:
        DirectDecompress Instance
        Throws:
        java.io.IOException - If output exceeds maxOutputSize, or other decoding error
      • getDecompressedData

        public byte[] getDecompressedData()
        Get decompressed data.
        Returns:
        byte array if decompression was successful else null
      • getDecompressedDataByteBuf

        public io.netty.buffer.ByteBuf getDecompressedDataByteBuf()
        Get decompressed data.
        Returns:
        ByteBuf if decompression was successful else null