public BitArray() { var maxBits = Enum.GetValues(typeof(TEnum)).Length; if (maxBits >= 512) { throw new Exception($"Cannot create a BitArray for enum {typeof(TEnum).Name}, because it has {maxBits} cases (max 512)."); } _data = new BitArray512(maxBits); }
public BitArray(System.Collections.BitArray bitArray) { if (bitArray.Length >= 512) { throw new ArgumentException($"Cannot construct BitArray512 from a BitArray of length {bitArray.Length}."); } _data = new BitArray512(bitArray.Length); for (var i = 0; i < bitArray.Length; i++) { _data.Set(i, bitArray[i]); } }