Table of Contents

Class BitBuffer

Namespace
ReFuel.Collections
Assembly
ReFuel.Common.dll

Compact boolean storage type.

public class BitBuffer : IEnumerable<bool>, IEnumerable
Inheritance
BitBuffer
Implements
Inherited Members

Constructors

BitBuffer()

public BitBuffer()

BitBuffer(int)

public BitBuffer(int capacity)

Parameters

capacity int

Properties

Capacity

Current capacity of the collection.

public int Capacity { get; }

Property Value

int

this[int]

Access the nth bit.

public bool this[int i] { get; set; }

Parameters

i int

The bit index.

Property Value

bool

Max

Maximum bit index ever set.

public int Max { get; }

Property Value

int

Methods

Clear()

public void Clear()

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<bool> GetEnumerator()

Returns

IEnumerator<bool>

An enumerator that can be used to iterate through the collection.

Reset(int)

Reset a bit.

public void Reset(int i)

Parameters

i int

Bit index to reset.

Set(int)

Set a bit.

public void Set(int i)

Parameters

i int

Bit index to set.

Toggle(int)

Toggle bit state.

public void Toggle(int i)

Parameters

i int

Bit index to toggle.

Trim()

Trim unused bits from the tail end of the structure.

public void Trim()