See Also: BitVector32 Members
System.Collections.Specialized.BitVector32 is more efficient than BitArray for Boolean values and small integers that are used internally. A BitArray can grow indefinitely as needed, but it has the memory and performance overhead that a class instance requires. In contrast, a System.Collections.Specialized.BitVector32 uses only 32 bits.
A System.Collections.Specialized.BitVector32 structure can be set up to contain either sections for small integers or bit flags for Booleans, but not both. A System.Collections.Specialized.BitVector32.Section is a window into the System.Collections.Specialized.BitVector32 and is composed of the smallest number of consecutive bits that can contain the maximum value specified in BitVector32.CreateSection(short). For example, a section with a maximum value of 1 is composed of only one bit, whereas a section with a maximum value of 5 is composed of three bits. You can create a System.Collections.Specialized.BitVector32.Section with a maximum value of 1 to serve as a Boolean, thereby allowing you to store integers and Booleans in the same System.Collections.Specialized.BitVector32.
Some members can be used for a System.Collections.Specialized.BitVector32 that is set up as sections, while other members can be used for one that is set up as bit flags. For example, the BitVector32.Item(System.Collections.Specialized.BitVector32.Section) property is the indexer for a System.Collections.Specialized.BitVector32 that is set up as sections, and the BitVector32.Item(int) property is the indexer for a System.Collections.Specialized.BitVector32 that is set up as bit flags. BitVector32.CreateMask creates a series of masks that can be used to access individual bits in a System.Collections.Specialized.BitVector32 that is set up as bit flags.
Using a mask on a System.Collections.Specialized.BitVector32 that is set up as sections might cause unexpected results.