Namespace: | Sirenix.Serialization |
Assembly: | Sirenix.Serialization |
public static class ProperBitConverter
This class always writes and reads bytes in a little endian format, regardless of system architecture.
public static string BytesToHexString(byte[] bytes, bool lowerCaseHexChars = true)
System.Byte[] | bytes | |
System.Boolean | lowerCaseHexChars |
System.String |
public static void GetBytes(byte[] buffer, int index, decimal value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Decimal | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, double value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Double | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, Guid value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Guid | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, short value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Int16 | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, int value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Int32 | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, long value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Int64 | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, float value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.Single | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, ushort value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.UInt16 | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, uint value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.UInt32 | value | The value to write. |
public static void GetBytes(byte[] buffer, int index, ulong value)
System.Byte[] | buffer | The buffer to write to. |
System.Int32 | index | The index to start writing at. |
System.UInt64 | value | The value to write. |
public static byte[] HexStringToBytes(string hex)
System.String | hex |
System.Byte[] |
public static decimal ToDecimal(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Decimal | The converted value. |
public static double ToDouble(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Double | The converted value. |
public static Guid ToGuid(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Guid | The converted value. |
public static short ToInt16(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Int16 | The converted value. |
public static int ToInt32(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Int32 | The converted value. |
public static long ToInt64(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Int64 | The converted value. |
public static float ToSingle(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.Single | The converted value. |
public static ushort ToUInt16(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.UInt16 | The converted value. |
public static uint ToUInt32(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.UInt32 | The converted value. |
public static ulong ToUInt64(byte[] buffer, int index)
System.Byte[] | buffer | The buffer to read from. |
System.Int32 | index | The index to start reading at. |
System.UInt64 | The converted value. |