Struct VL64
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
MinValue
The minimum value of a VL64.
public const int MinValue = -2147483647
Field Value
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
Encode(Span<byte>, VL64)
Encodes a VL64 value to the specified byte span.
public static void Encode(Span<byte> buf, VL64 value)
Parameters
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
ToString()
Returns the value of this VL64 as a string.
public override string ToString()
Returns
Operators
implicit operator VL64(int)
public static implicit operator VL64(int value)
Parameters
value
int
Returns
implicit operator int(VL64)
public static implicit operator int(VL64 vl64)
Parameters
vl64
VL64