Class BitArrayExtensions
Extends BitArray type.
Inherited Members
Namespace: DotNext.Collections
Assembly: DotNext.dll
Syntax
public static class BitArrayExtensions
Methods
View SourceCreate(ReadOnlySpan<byte>)
Creates an array of bits from the bytes.
Declaration
public static BitArray Create(ReadOnlySpan<byte> source)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | source | The sequence of bytes. |
Returns
| Type | Description |
|---|---|
| BitArray | An array of bits reconstructed from the array of bytes. |
Create<T>(in T)
Creates an array of bits from the blittable value.
Declaration
public static BitArray Create<T>(in T value) where T : unmanaged, allows ref struct
Parameters
| Type | Name | Description |
|---|---|---|
| T | value | The value to convert to the bits. |
Returns
| Type | Description |
|---|---|
| BitArray |
|
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value. |
get_PopCount(BitArray)
Gets the number of bits set to 1.
Declaration
public static int get_PopCount(BitArray array)
Parameters
| Type | Name | Description |
|---|---|---|
| BitArray | array |
Returns
| Type | Description |
|---|---|
| int |
get_SetBits(BitArray)
Gets an enumerator over indices of set bits.
Declaration
public static BitArrayExtensions.SetBitsEnumerator get_SetBits(BitArray array)
Parameters
| Type | Name | Description |
|---|---|---|
| BitArray | array |
Returns
| Type | Description |
|---|---|
| BitArrayExtensions.SetBitsEnumerator |