public static byte getNumBits(final int maxValue) {
    byte numBits = 1;
    while ((1 << numBits) <= maxValue) {
      numBits++;
    }
    return numBits;
  }
Get the next bit mask position while checking that the value should not exceed given maximum
value.
geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java