Search Results for

    Show / Hide Table of Contents

    Converter Class

    Namespace: Riptide.Utils
    Assembly: RiptideNetworking.dll

    Provides functionality for converting bits and bytes to various value types and vice versa.

    public class Converter
    Inheritance
    object
    Converter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Fields

    BitsPerByte

    The number of bits in a byte.

    BitsPerULong

    The number of bits in a ulong.

    Methods

    BoolFromBit(byte[], int)

    Converts the bit at startBit in array to a bool.

    BoolFromBit(ulong[], int)

    Converts the bit at startBit in array to a bool.

    BoolToBit(bool, byte[], int)

    Converts value to a bit and writes it into array at startBit.

    BoolToBit(bool, ulong[], int)

    Converts value to a bit and writes it into array at startBit.

    ByteFromBits(byte[], int)

    Converts the 8 bits at startBit in array to a byte.

    ByteFromBits(ulong[], int)

    Converts the 8 bits at startBit in array to a byte.

    ByteToBits(byte, byte[], int)

    Converts value to 8 bits and writes them into array at startBit.

    ByteToBits(byte, ulong[], int)

    Converts value to 8 bits and writes them into array at startBit.

    DoubleFromBits(byte[], int)

    Converts the 64 bits at startBit in array to a double.

    DoubleFromBits(ulong[], int)

    Converts the 64 bits at startBit in array to a double.

    DoubleToBits(double, byte[], int)

    Converts value to 64 bits and writes them into array at startBit.

    DoubleToBits(double, ulong[], int)

    Converts value to 64 bits and writes them into array at startBit.

    FloatFromBits(byte[], int)

    Converts the 32 bits at startBit in array to a float.

    FloatFromBits(ulong[], int)

    Converts the 32 bits at startBit in array to a float.

    FloatToBits(float, byte[], int)

    Converts value to 32 bits and writes them into array at startBit.

    FloatToBits(float, ulong[], int)

    Converts value to 32 bits and writes them into array at startBit.

    FromDouble(double, byte[], int)

    Converts a given double to bytes and writes them into the given array.

    FromFloat(float, byte[], int)

    Converts a given float to bytes and writes them into the given array.

    FromInt(int, byte[], int)

    Converts a given int to bytes and writes them into the given array.

    FromLong(long, byte[], int)

    Converts a given long to bytes and writes them into the given array.

    FromShort(short, byte[], int)

    Converts a given short to bytes and writes them into the given array.

    FromUInt(uint, byte[], int)

    Converts a given uint to bytes and writes them into the given array.

    FromULong(ulong, byte[], int)

    Converts a given ulong to bytes and writes them into the given array.

    FromUShort(ushort, byte[], int)

    Converts a given ushort to bytes and writes them into the given array.

    GetBits(int, byte[], int, out byte)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, byte[], int, out ushort)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, byte[], int, out uint)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, byte[], int, out ulong)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, ulong[], int, out byte)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, ulong[], int, out ushort)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, ulong[], int, out uint)

    Starting at startBit, reads amount bits from array into bitfield.

    GetBits(int, ulong[], int, out ulong)

    Starting at startBit, reads amount bits from array into bitfield.

    IntFromBits(byte[], int)

    Converts the 32 bits at startBit in array to an int.

    IntFromBits(ulong[], int)

    Converts the 32 bits at startBit in array to an int.

    IntToBits(int, byte[], int)

    Converts value to 32 bits and writes them into array at startBit.

    IntToBits(int, ulong[], int)

    Converts value to 32 bits and writes them into array at startBit.

    LongFromBits(byte[], int)

    Converts the 64 bits at startBit in array to a long.

    LongFromBits(ulong[], int)

    Converts the 64 bits at startBit in array to a long.

    LongToBits(long, byte[], int)

    Converts value to 64 bits and writes them into array at startBit.

    LongToBits(long, ulong[], int)

    Converts value to 64 bits and writes them into array at startBit.

    SByteFromBits(byte[], int)

    Converts the 8 bits at startBit in array to an sbyte.

    SByteFromBits(ulong[], int)

    Converts the 8 bits at startBit in array to an sbyte.

    SByteToBits(sbyte, byte[], int)

    Converts value to 8 bits and writes them into array at startBit.

    SByteToBits(sbyte, ulong[], int)

    Converts value to 8 bits and writes them into array at startBit.

    SetBits(byte, int, byte[], int)

    Takes amount bits from bitfield and writes them into array, starting at startBit.

    SetBits(ushort, int, byte[], int)

    Takes amount bits from bitfield and writes them into array, starting at startBit.

    SetBits(uint, int, byte[], int)

    Takes amount bits from bitfield and writes them into array, starting at startBit.

    SetBits(ulong, int, byte[], int)

    Takes amount bits from bitfield and writes them into array, starting at startBit.

    SetBits(ulong, int, ulong[], int)

    Takes amount bits from bitfield and writes them into array, starting at startBit.

    ShortFromBits(byte[], int)

    Converts the 16 bits at startBit in array to a short.

    ShortFromBits(ulong[], int)

    Converts the 16 bits at startBit in array to a short.

    ShortToBits(short, byte[], int)

    Converts value to 16 bits and writes them into array at startBit.

    ShortToBits(short, ulong[], int)

    Converts value to 16 bits and writes them into array at startBit.

    ToDouble(byte[], int)

    Converts the 8 bytes in the array at startIndex to a double.

    ToFloat(byte[], int)

    Converts the 4 bytes in the array at startIndex to a float.

    ToInt(byte[], int)

    Converts the 4 bytes in the array at startIndex to a int.

    ToLong(byte[], int)

    Converts the 8 bytes in the array at startIndex to a long.

    ToShort(byte[], int)

    Converts the 2 bytes in the array at startIndex to a short.

    ToUInt(byte[], int)

    Converts the 4 bytes in the array at startIndex to a uint.

    ToULong(byte[], int)

    Converts the 8 bytes in the array at startIndex to a ulong.

    ToUShort(byte[], int)

    Converts the 2 bytes in the array at startIndex to a ushort.

    UIntFromBits(byte[], int)

    Converts the 32 bits at startBit in array to a uint.

    UIntFromBits(ulong[], int)

    Converts the 32 bits at startBit in array to a uint.

    UIntToBits(uint, byte[], int)

    Converts value to 32 bits and writes them into array at startBit.

    UIntToBits(uint, ulong[], int)

    Converts value to 32 bits and writes them into array at startBit.

    ULongFromBits(byte[], int)

    Converts the 64 bits at startBit in array to a ulong.

    ULongFromBits(ulong[], int)

    Converts the 64 bits at startBit in array to a ulong.

    ULongToBits(ulong, byte[], int)

    Converts value to 64 bits and writes them into array at startBit.

    ULongToBits(ulong, ulong[], int)

    Converts value to 64 bits and writes them into array at startBit.

    UShortFromBits(byte[], int)

    Converts the 16 bits at startBit in array to a ushort.

    UShortFromBits(ulong[], int)

    Converts the 16 bits at startBit in array to a ushort.

    UShortToBits(ushort, byte[], int)

    Converts value to 16 bits and writes them into array at startBit.

    UShortToBits(ushort, ulong[], int)

    Converts value to 16 bits and writes them into array at startBit.

    ZigZagDecode(int)

    Zig zag decodes value.

    ZigZagDecode(long)

    Zig zag decodes value.

    ZigZagEncode(int)

    Zig zag encodes value.

    ZigZagEncode(long)

    Zig zag encodes value.

    • Improve this Doc
    • View Source
    • Support Riptide
    In This Article
    Back to top Copyright © Tom Weiland 2022
    Made with DocFX