Struct BigSize
- Namespace
- NLightning.Common.Types
- Assembly
- NLightning.Common.dll
Represents a variable length integer.
public readonly struct BigSize : IComparable
- Implements
- Inherited Members
Remarks
Initializes a new instance of the BigSize struct.
Constructors
BigSize(ulong)
Represents a variable length integer.
public BigSize(ulong value)
Parameters
value
ulongThe value of the big size.
Remarks
Initializes a new instance of the BigSize struct.
Properties
Value
The uint representation of the big size.
public ulong Value { get; }
Property Value
Methods
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes obj
in the sort order.Zero This instance occurs in the same position in the sort order as obj
.Greater than zero This instance follows obj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
DeserializeAsync(Stream)
Deserializes a big size from a BinaryReader.
public static Task<BigSize> DeserializeAsync(Stream stream)
Parameters
stream
StreamThe stream to deserialize from.
Returns
Exceptions
- ArgumentException
Thrown when the stream is empty or insufficient data is available.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
SerializeAsync(Stream)
Serializes a big size to a BinaryWriter.
public Task SerializeAsync(Stream stream)
Parameters
stream
StreamThe stream to serialize to.
Returns
Operators
operator ==(BigSize, BigSize)
public static bool operator ==(BigSize left, BigSize right)
Parameters
Returns
operator >(BigSize, BigSize)
public static bool operator >(BigSize left, BigSize right)
Parameters
Returns
operator >=(BigSize, BigSize)
public static bool operator >=(BigSize left, BigSize right)
Parameters
Returns
implicit operator byte(BigSize)
public static implicit operator byte(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator short(BigSize)
public static implicit operator short(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator int(BigSize)
public static implicit operator int(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator long(BigSize)
public static implicit operator long(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator ushort(BigSize)
public static implicit operator ushort(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator uint(BigSize)
public static implicit operator uint(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator ulong(BigSize)
public static implicit operator ulong(BigSize bigSize)
Parameters
bigSize
BigSize
Returns
implicit operator BigSize(byte)
public static implicit operator BigSize(byte value)
Parameters
value
byte
Returns
implicit operator BigSize(short)
public static implicit operator BigSize(short value)
Parameters
value
short
Returns
implicit operator BigSize(int)
public static implicit operator BigSize(int value)
Parameters
value
int
Returns
implicit operator BigSize(long)
public static implicit operator BigSize(long value)
Parameters
value
long
Returns
implicit operator BigSize(ushort)
public static implicit operator BigSize(ushort value)
Parameters
value
ushort
Returns
implicit operator BigSize(uint)
public static implicit operator BigSize(uint value)
Parameters
value
uint
Returns
implicit operator BigSize(ulong)
public static implicit operator BigSize(ulong value)
Parameters
value
ulong
Returns
operator !=(BigSize, BigSize)
public static bool operator !=(BigSize left, BigSize right)
Parameters
Returns
operator <(BigSize, BigSize)
public static bool operator <(BigSize left, BigSize right)
Parameters
Returns
operator <=(BigSize, BigSize)
public static bool operator <=(BigSize left, BigSize right)