BencodeInteger Class

A bencode integer. Bencode does not bound integers, so a value can be larger than a Int64.

public sealed class BencodeInteger : BencodeValue, IEquatable<BencodeInteger>
Inheritance
BencodeValue BencodeInteger
Implements

Constructors

NameDescription
BencodeInteger(long)
BencodeInteger(BigInteger)

BencodeInteger overloads

BencodeInteger(long)

BencodeInteger.cs
public BencodeInteger(long value)
Parameters
value long

No documentation is available.

BencodeInteger(BigInteger)

BencodeInteger.cs
public BencodeInteger(BigInteger value)
Parameters
value BigInteger

No documentation is available.

Properties

NameDescription
BigIntegerValueGets the value, whatever its size.
IsInt64Gets a value indicating whether the value fits in a Int64.
Kind
ValueGets the value as a Int64.

BigIntegerValue

BencodeInteger.cs

Gets the value, whatever its size.

public BigInteger BigIntegerValue { get; }

Property value

BigInteger

Gets a value indicating whether the value fits in a Int64.

public bool IsInt64 { get; }

Property value

bool

public override BencodeValueKind Kind { get; }

Property value

BencodeValueKind

No documentation is available.

Gets the value as a Int64.

public long Value { get; }

Property value

long

Exceptions

InvalidOperationException
The value does not fit in a Int64. Use BencodeInteger.BigIntegerValue or BencodeInteger.TryGetInt64.

Methods

NameDescription
Equals(BencodeInteger?)
Equals(object?)
GetHashCode()
ToString()
TryGetInt64(long)Gets the value as a Int64 when it fits in one.
WriteTo(BencodeWriter, bool)

Equals overloads

Equals(BencodeInteger?)

BencodeInteger.cs
public bool Equals(BencodeInteger? other)
Parameters
other BencodeInteger?
Returns

bool

No documentation is available.

Equals(object?)

BencodeInteger.cs
public override bool Equals(object? obj)
Parameters
obj object?
Returns

bool

No documentation is available.

GetHashCode()

BencodeInteger.cs
public override int GetHashCode()

Returns

int

No documentation is available.

public override string ToString()

Returns

string

No documentation is available.

TryGetInt64(long)

BencodeInteger.cs

Gets the value as a Int64 when it fits in one.

public bool TryGetInt64(out long value)

Parameters

value long

Returns

bool

WriteTo(BencodeWriter, bool)

BencodeInteger.cs
public override void WriteTo(BencodeWriter writer, bool canonical)

Parameters

writer BencodeWriter
canonical bool

No documentation is available.