public static int roundInt2(int v) {
    v = Integer.highestOneBit(v) << 1;
    if (v < 0) {
      return Integer.MAX_VALUE;
    }
    return v;
  }
Round up to the next power of two, unless the value would become negative (ints are signed), in
which case just return Integer.MAX_VALUE.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/compress/CompressionUtil.java