Class BEncodedNumber
Class representing a BEncoded number
Implements
System.IComparable<BEncodedNumber>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: MonoTorrent.BEncoding
Assembly: MonoTorrent.dll
Syntax
public class BEncodedNumber : BEncodedValue, IComparable<BEncodedNumber>
Constructors
BEncodedNumber()
Declaration
public BEncodedNumber()
BEncodedNumber(Int64)
Create a new BEncoded number with the given value
Declaration
public BEncodedNumber(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value | The value of the BEncodedNumber |
Properties
Number
The value of the BEncodedNumber
Declaration
public long Number { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
Methods
CompareTo(BEncodedNumber)
Declaration
public int CompareTo(BEncodedNumber other)
Parameters
| Type | Name | Description |
|---|---|---|
| BEncodedNumber | other |
Returns
| Type | Description |
|---|---|
| System.Int32 |
CompareTo(Int64)
Declaration
public int CompareTo(long other)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | other |
Returns
| Type | Description |
|---|---|
| System.Int32 |
CompareTo(Object)
Declaration
public int CompareTo(object other)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | other |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Encode(Byte[], Int32)
Encodes this number to the supplied byte[] starting at the supplied offset
Declaration
public override int Encode(byte[] buffer, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | The buffer to write the data to |
| System.Int32 | offset | The offset to start writing the data at |
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
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)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
System.Object.GetHashCode()
LengthInBytes()
Returns the length of the encoded string in bytes
Declaration
public override int LengthInBytes()
Returns
| Type | Description |
|---|---|
| System.Int32 |
Overrides
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
System.Object.ToString()
Operators
Implicit(Int64 to BEncodedNumber)
Declaration
public static implicit operator BEncodedNumber(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | value |
Returns
| Type | Description |
|---|---|
| BEncodedNumber |
Implements
System.IComparable<T>