public class BitString
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
BitString(byte[] bitString,
int numBits)
Construct a new bit string object.
|
Modifier and Type | Method and Description |
---|---|
BitString |
clone() |
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 byte[] getBitString()
public int getNumBits()
getBitString()
public BitString clone()
clone
in class java.lang.Object