The bits in the shortest two's complement spelling, not counting the sign bit, the same count java.math.BigInteger.bitLength gives.
java.math.BigInteger.bitLength