/// A simple, fast array of bits, represented compactly by an array of ints internally.
///
/// @author Sean Owen
///
public sealed class BitArray
{
private int[] bits;
private int size;
public BitArray()
{
this.size = 0;
this.bits = new int[1];
}
public BitArray(int size)
{
this.size = size;
this.bits = makeArray(size);
}
public int Size
{
get
{
return size;
}
}
public int SizeInBytes
{
get
{
return (size + 7) >> 3;
}
}
private void ensureCapacity(int size)
{
if (size > bits.Length << 5)
{
int[] newBits = makeArray(size);
Array.Copy(bits, 0, newBits, 0, bits.Length);
this.bits = newBits;
}
}
///