Class Utils


  • public final class Utils
    extends java.lang.Object
    Utilities class for Brotli4j
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int maxCompressedSize​(int input_size)
      Returns the maximum compressed size for the given input size.
      • Methods inherited from class java.lang.Object

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

      • maxCompressedSize

        public static int maxCompressedSize​(int input_size)
        Returns the maximum compressed size for the given input size.

        This method is based on the original implementation of the Brotli library and works only for direct compression, not stream compression. This is useful to allocating buffers for compressed data.
        Parameters:
        input_size - The input size.
        Returns:
        The maximum compressed size.
        Throws:
        java.lang.IllegalArgumentException - If the input size is negative.