@Test public void bitCountToByteCount() { Assert.assertEquals(0, MathUtils.bitCountToByteCount(0)); Assert.assertEquals(1, MathUtils.bitCountToByteCount(1)); Assert.assertEquals(1, MathUtils.bitCountToByteCount(8)); Assert.assertEquals(2, MathUtils.bitCountToByteCount(9)); Assert.assertEquals(2, MathUtils.bitCountToByteCount(16)); Assert.assertEquals(3, MathUtils.bitCountToByteCount(17)); }
public static int bitCountToByteCount(int bitCount) { return (bitCount + 7) >>> 3; }
MathUtils { public static int bitCountToByteCount(int bitCount) { return (bitCount + 7) >>> 3; } }
MathUtils { public static int bitCountToByteCount(int bitCount) { return (bitCount + 7) >>> 3; } private  MathUtils(); }
MathUtils { public static int bitCountToByteCount(int bitCount) { return (bitCount + 7) >>> 3; } private  MathUtils(); static int gcd(int a, int b); static byte[] nonNegativeLongToBigEndianBytes(int byteCount, long value); static long unsignedBigEndianBytesToNonNegativeLong(byte[] bytes); static int bitCountToByteCount(int bitCount); static byte[] doubleToBytes(double value); static double bytesToDouble(byte[] bytes); static int numberOfLeadingZeros(byte b); }
MathUtils { public static int bitCountToByteCount(int bitCount) { return (bitCount + 7) >>> 3; } private  MathUtils(); static int gcd(int a, int b); static byte[] nonNegativeLongToBigEndianBytes(int byteCount, long value); static long unsignedBigEndianBytesToNonNegativeLong(byte[] bytes); static int bitCountToByteCount(int bitCount); static byte[] doubleToBytes(double value); static double bytesToDouble(byte[] bytes); static int numberOfLeadingZeros(byte b);  }