Class Utils

java.lang.Object
com.aayushatharva.brotli4j.common.Utils

public final class Utils extends Object
Utilities class for Brotli4j
  • Method Details

    • 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:
      IllegalArgumentException - If the input size is negative.