Class CommonUtil

java.lang.Object
org.apache.arrow.memory.util.CommonUtil

public final class CommonUtil extends Object
Utilities and static methods needed for arrow-memory.
  • Method Details

    • nextPowerOfTwo

      public static int nextPowerOfTwo(int val)
      Rounds up the provided value to the nearest power of two.
      Parameters:
      val - An integer value.
      Returns:
      The closest power of two of that value.
    • nextPowerOfTwo

      public static long nextPowerOfTwo(long val)
      Rounds up the provided value to the nearest power of two.
      Parameters:
      val - A long value.
      Returns:
      The closest power of two of that value.
    • indent

      public static StringBuilder indent(StringBuilder sb, int indent)
      Specify an indentation amount when using a StringBuilder.
      Parameters:
      sb - StringBuilder to use
      indent - Indentation amount
      Returns:
      the StringBuilder object with indentation applied