public class BitString
extends java.lang.Object
Constructor and Description |
---|
BitString(BitString other)
Copy Constructor.
|
BitString(byte[] bitString,
int numBits)
Construct a new bit string object.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBitString()
Get the bit string as byte array.
|
int |
getNumBits()
The number of bits in the byte array.
|
public BitString(byte[] bitString, int numBits) throws java.lang.IllegalArgumentException
bitString
- as a a byte array.numBits
- the number of bits.java.lang.IllegalArgumentException
- if the passed number of is is out of range.numBits <= (bitString.length - 1) * 8 + 1 || numBits > bitString.length * 8
public BitString(BitString other)
other
- the other bit string,public byte[] getBitString()
public int getNumBits()
getBitString()