Table of Contents

Struct VL64

Namespace
Xabbo.Messages
Assembly
Xabbo.Common.dll

Represents a signed variable-length radix-64 encoded integer.

public readonly record struct VL64 : IEquatable<VL64>
Implements
Inherited Members

Fields

MaxValue

The maximum value of a VL64.

public const int MaxValue = 2147483647

Field Value

int

MinValue

The minimum value of a VL64.

public const int MinValue = -2147483647

Field Value

int

Methods

Decode(ReadOnlySpan<byte>)

Decodes a VL64 value from the specified read-only byte span.

public static VL64 Decode(ReadOnlySpan<byte> buf)

Parameters

buf ReadOnlySpan<byte>

The span to decode from.

Returns

VL64

The decoded VL64 value.

Exceptions

ArgumentOutOfRangeException

If the provided span does not have enough bytes to decode a VL64 based on the length decoded from the first byte.

ArgumentException

If the length decoded from the first byte is outside the valid range of 1-6, or any of the input bytes' 2 most significant bits are not set to 01.

DecodeLength(byte)

Returns the number of bytes required to decode a VL64, given (and including) the first byte.

public static int DecodeLength(byte value)

Parameters

value byte

Returns

int

Encode(Span<byte>, VL64)

Encodes a VL64 value to the specified byte span.

public static void Encode(Span<byte> buf, VL64 value)

Parameters

buf Span<byte>

The span to encode into.

value VL64

The value to encode.

Exceptions

ArgumentOutOfRangeException

If the value is outside the range of a VL64.

ArgumentException

If the length of the provided span is insufficient to encode the specified VL64 value.

EncodeLength(VL64)

Returns the number of bytes required to represent the specified VL64.

public static int EncodeLength(VL64 value)

Parameters

value VL64

Returns

int

ToString()

Returns the value of this VL64 as a string.

public override string ToString()

Returns

string

Operators

implicit operator VL64(int)

public static implicit operator VL64(int value)

Parameters

value int

Returns

VL64

implicit operator int(VL64)

public static implicit operator int(VL64 vl64)

Parameters

vl64 VL64

Returns

int