Class BitField
This class is for represting the Peer's bitfield
Inheritance
System.Object
BitField
Implements
System.Collections.Generic.IEnumerable<System.Boolean>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: MonoTorrent.dll
Syntax
public class BitField : IEnumerable<bool>, IEnumerable
Constructors
BitField(BitField)
Declaration
public BitField(BitField other)
Parameters
BitField(Boolean[])
Declaration
public BitField(bool[] array)
Parameters
| Type |
Name |
Description |
| System.Boolean[] |
array |
|
BitField(Byte[], Int32)
Declaration
public BitField(byte[] array, int length)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
array |
|
| System.Int32 |
length |
|
BitField(Int32)
Declaration
public BitField(int length)
Parameters
| Type |
Name |
Description |
| System.Int32 |
length |
|
Properties
AllFalse
Declaration
public bool AllFalse { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
AllTrue
Declaration
public bool AllTrue { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Item[Int32]
Declaration
public bool this[int index] { get; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Property Value
| Type |
Description |
| System.Boolean |
|
Length
Declaration
public int Length { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
PercentComplete
Declaration
public double PercentComplete { get; }
Property Value
| Type |
Description |
| System.Double |
|
TrueCount
Declaration
public int TrueCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
FirstFalse()
Returns the index of the first false bit in the bitfield.
Returns -1 if no false bit is found. />
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
FirstFalse(Int32, Int32)
Returns the index of the first false bit between startIndex and endIndex (inclusive).
Returns -1 if no false bit is found. />
Declaration
public int FirstFalse(int startIndex, int endIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
startIndex |
The first index to check
|
| System.Int32 |
endIndex |
The last index to check
|
Returns
| Type |
Description |
| System.Int32 |
|
FirstTrue()
Returns the index of the first true bit in the bitfield.
Returns -1 if no true bit is found. />
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
FirstTrue(Int32, Int32)
Returns the index of the first true bit between startIndex and endIndex (inclusive).
Returns -1 if no true bit is found. />
Declaration
public int FirstTrue(int startIndex, int endIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
startIndex |
The first index to check
|
| System.Int32 |
endIndex |
The last index to check
|
Returns
| Type |
Description |
| System.Int32 |
|
GetEnumerator()
Declaration
public IEnumerator<bool> GetEnumerator()
Returns
| Type |
Description |
| System.Collections.Generic.IEnumerator<System.Boolean> |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.Object.GetHashCode()
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable