- public BigInteger getUnsignedValue()
- {
- if (!isBinary())
- throw new NumberFormatException("BitVector is non binary: " + toString());
- byte[] bytes = new byte[(bits.length / 8) + 1];
- for (int i = 0; i < bits.length; i++)
- {
- if (Bit.ONE == bits[i])
- {
- bytes[i / 8] |= 1 << (i % 8);
- }
- }
- return new BigInteger(bytes);
- }
-
- public static BitVector from(BigInteger b, int length)