Skip to content

Class NumberExtensions

Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll

Contains extension methods dealing with endianness of numeric types.

public static class NumberExtensions

Inheritance

objectNumberExtensions

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

IsValidUnquoted(char)

public static bool IsValidUnquoted(this char c)

Parameters

c char

Returns

bool

SwapEndian(short)

Swap the endian of the given value.

public static short SwapEndian(this short value)

Parameters

value short

The value to swap endian of.

Returns

short

The value with bytes in opposite format.

SwapEndian(ushort)

Swap the endian of the given value.

public static ushort SwapEndian(this ushort value)

Parameters

value ushort

The value to swap endian of.

Returns

ushort

The value with bytes in opposite format.

SwapEndian(int)

Swap the endian of the given value.

public static int SwapEndian(this int value)

Parameters

value int

The value to swap endian of.

Returns

int

The value with bytes in opposite format.

SwapEndian(uint)

Swap the endian of the given value.

public static uint SwapEndian(this uint value)

Parameters

value uint

The value to swap endian of.

Returns

uint

The value with bytes in opposite format.

SwapEndian(ulong)

Swap the endian of the given value.

public static ulong SwapEndian(this ulong value)

Parameters

value ulong

The value to swap endian of.

Returns

ulong

The value with bytes in opposite format.

SwapEndian(long)

Swap the endian of the given value.

public static long SwapEndian(this long value)

Parameters

value long

The value to swap endian of.

Returns

long

The value with bytes in opposite format.

SwapEndian(float)

Swap the endian of the given value.

public static float SwapEndian(this float value)

Parameters

value float

The value to swap endian of.

Returns

float

The value with bytes in opposite format.

SwapEndian(double)

Swap the endian of the given value.

public static double SwapEndian(this double value)

Parameters

value double

The value to swap endian of.

Returns

double

The value with bytes in opposite format.