BitArray BitArray BitArray BitArray Constructors

Definition

Overloads

BitArray(Boolean[]) BitArray(Boolean[]) BitArray(Boolean[]) BitArray(Boolean[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of Booleans.

BitArray(Byte[]) BitArray(Byte[]) BitArray(Byte[]) BitArray(Byte[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of bytes.

BitArray(BitArray) BitArray(BitArray) BitArray(BitArray) BitArray(BitArray)

Initializes a new instance of the BitArray class that contains bit values copied from the specified BitArray.

BitArray(Int32) BitArray(Int32) BitArray(Int32) BitArray(Int32)

Initializes a new instance of the BitArray class that can hold the specified number of bit values, which are initially set to false.

BitArray(Int32[]) BitArray(Int32[]) BitArray(Int32[]) BitArray(Int32[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of 32-bit integers.

BitArray(Int32, Boolean) BitArray(Int32, Boolean) BitArray(Int32, Boolean) BitArray(Int32, Boolean)

Initializes a new instance of the BitArray class that can hold the specified number of bit values, which are initially set to the specified value.

BitArray(Boolean[]) BitArray(Boolean[]) BitArray(Boolean[]) BitArray(Boolean[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of Booleans.

public:
 BitArray(cli::array <bool> ^ values);
public BitArray (bool[] values);
new System.Collections.BitArray : bool[] -> System.Collections.BitArray
Public Sub New (values As Boolean())

Parameters

values
Boolean[]

An array of Booleans to copy.

Exceptions

Remarks

This constructor is an O(n) operation, where n is the number of elements in values.

BitArray(Byte[]) BitArray(Byte[]) BitArray(Byte[]) BitArray(Byte[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of bytes.

public:
 BitArray(cli::array <System::Byte> ^ bytes);
public BitArray (byte[] bytes);
new System.Collections.BitArray : byte[] -> System.Collections.BitArray
Public Sub New (bytes As Byte())

Parameters

bytes
Byte[]

An array of bytes containing the values to copy, where each byte represents eight consecutive bits.

Exceptions

Remarks

The first byte in the array represents bits 0 through 7, the second byte represents bits 8 through 15, and so on. The Least Significant Bit of each byte represents the lowest index value: " bytes [0] & 1" represents bit 0, " bytes [0] & 2" represents bit 1, " bytes [0] & 4" represents bit 2, and so on.

This constructor is an O(n) operation, where n is the number of elements in bytes.

BitArray(BitArray) BitArray(BitArray) BitArray(BitArray) BitArray(BitArray)

Initializes a new instance of the BitArray class that contains bit values copied from the specified BitArray.

public:
 BitArray(System::Collections::BitArray ^ bits);
public BitArray (System.Collections.BitArray bits);
new System.Collections.BitArray : System.Collections.BitArray -> System.Collections.BitArray
Public Sub New (bits As BitArray)

Parameters

Exceptions

Remarks

This constructor is an O(n) operation, where n is the number of elements in bits.

BitArray(Int32) BitArray(Int32) BitArray(Int32) BitArray(Int32)

Initializes a new instance of the BitArray class that can hold the specified number of bit values, which are initially set to false.

public:
 BitArray(int length);
public BitArray (int length);
new System.Collections.BitArray : int -> System.Collections.BitArray
Public Sub New (length As Integer)

Parameters

length
Int32 Int32 Int32 Int32

The number of bit values in the new BitArray.

Exceptions

Remarks

This constructor is an O(n) operation, where n is length.

BitArray(Int32[]) BitArray(Int32[]) BitArray(Int32[]) BitArray(Int32[])

Initializes a new instance of the BitArray class that contains bit values copied from the specified array of 32-bit integers.

public:
 BitArray(cli::array <int> ^ values);
public BitArray (int[] values);
new System.Collections.BitArray : int[] -> System.Collections.BitArray
Public Sub New (values As Integer())

Parameters

values
Int32[]

An array of integers containing the values to copy, where each integer represents 32 consecutive bits.

Exceptions

Remarks

The number in the first values array element represents bits 0 through 31, the second number in the array represents bits 32 through 63, and so on. The Least Significant Bit of each integer represents the lowest index value: " values [0] & 1" represents bit 0, " values [0] & 2" represents bit 1, " values [0] & 4" represents bit 2, and so on.

This constructor is an O(n) operation, where n is the number of elements in values.

BitArray(Int32, Boolean) BitArray(Int32, Boolean) BitArray(Int32, Boolean) BitArray(Int32, Boolean)

Initializes a new instance of the BitArray class that can hold the specified number of bit values, which are initially set to the specified value.

public:
 BitArray(int length, bool defaultValue);
public BitArray (int length, bool defaultValue);
new System.Collections.BitArray : int * bool -> System.Collections.BitArray
Public Sub New (length As Integer, defaultValue As Boolean)

Parameters

length
Int32 Int32 Int32 Int32

The number of bit values in the new BitArray.

defaultValue
Boolean Boolean Boolean Boolean

The Boolean value to assign to each bit.

Exceptions

Remarks

This constructor is an O(n) operation, where n is length.

Applies to