Show / Hide Table of Contents

Class BitArrayExtensions

Extends BitArray type.

Inheritance
object
BitArrayExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Collections
Assembly: DotNext.dll
Syntax
public static class BitArrayExtensions

Methods

View Source

Create(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.

View Source

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

value represented as an array of bits.

Type Parameters
Name Description
T

The type of the value.

View Source

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
View Source

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
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾