System.Collections.BitArray.BitArray C# (CSharp) Method

BitArray() public method

public BitArray ( int length, bool defaultValue ) : System.Diagnostics
length int
defaultValue bool
return System.Diagnostics
        public BitArray(int length, bool defaultValue)
        {
            if (length < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(length), length, SR.ArgumentOutOfRange_NeedNonNegNum);
            }
            Contract.EndContractBlock();

            m_array = new int[GetArrayLength(length, BitsPerInt32)];
            m_length = length;

            int fillValue = defaultValue ? unchecked(((int)0xffffffff)) : 0;
            for (int i = 0; i < m_array.Length; i++)
            {
                m_array[i] = fillValue;
            }

            _version = 0;
        }

Same methods

BitArray::BitArray ( ) : System.Diagnostics
BitArray::BitArray ( BitArray bits ) : System.Diagnostics
BitArray::BitArray ( bool values ) : System.Diagnostics
BitArray::BitArray ( byte bytes ) : System.Diagnostics
BitArray::BitArray ( int length ) : System.Diagnostics