/// <returns>A <see cref="char"/> representation of the binary data.</returns> public char AsChar() { unsafe { fixed(ushort *dataPtr = &m_data) return(BinaryConversionUtility.ToData <char>((byte *)dataPtr)); } }
/// <returns>A <see cref="long"/> representation of the binary data.</returns> public long ToInt64() { unsafe { fixed(ulong *dataPtr = &m_data) return(BinaryConversionUtility.ToData <long>((byte *)dataPtr)); } }
/// <returns>A <see cref="double"/> representation of the binary data.</returns> public double ToDouble() { unsafe { fixed(ulong *dataPtr = &m_data) return(BinaryConversionUtility.ToData <double>((byte *)dataPtr)); } }
/// <returns>A <see cref="short"/> representation of the binary data.</returns> public short AsInt16() { unsafe { fixed(ushort *dataPtr = &m_data) return(BinaryConversionUtility.ToData <short>((byte *)dataPtr)); } }
/// <returns>A <see cref="float"/> representation of the binary data.</returns> public float ToSingle() { unsafe { fixed(uint *dataPtr = &m_data) return(BinaryConversionUtility.ToData <float>((byte *)dataPtr)); } }
/// <returns>A <see cref="int"/> representation of the binary data.</returns> public int ToInt32() { unsafe { fixed(uint *dataPtr = &m_data) return(BinaryConversionUtility.ToData <int>((byte *)dataPtr)); } }
public unsafe Binary64(byte *ptr) { m_data = BinaryConversionUtility.ToData <uint>(*(ptr + 0), *(ptr + 1), *(ptr + 2), *(ptr + 3), *(ptr + 4), *(ptr + 5), *(ptr + 6), *(ptr + 7)); }
public unsafe Binary16(byte *ptr) { m_data = BinaryConversionUtility.ToData <ushort>(*(ptr + 0), *(ptr + 1)); }
public unsafe Binary32(byte *ptr) { m_data = BinaryConversionUtility.ToData <uint>(*(ptr + 0), *(ptr + 1), *(ptr + 2), *(ptr + 3)); }
/// <returns>A <see cref="char"/> representation of the binary data.</returns> public static char ToChar(byte b0, byte b1) { return(BinaryConversionUtility.ToData <char>(b0, b1)); }
/// <returns>A <see cref="double"/> representation of the binary data.</returns> public static unsafe double ToDouble(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7) { return(BinaryConversionUtility.ToData <double>(b0, b1, b2, b3, b4, b5, b6, b7)); }
/// <returns>A <see cref="float"/> representation of the binary data.</returns> public static unsafe float ToSingle(byte b0, byte b1, byte b2, byte b3) { return(BinaryConversionUtility.ToData <float>(b0, b1, b2, b3)); }
/// <returns>A <see cref="ulong"/> representation of the binary data.</returns> public static ulong ToUInt64(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7) { return(BinaryConversionUtility.ToData <ulong>(b0, b1, b2, b3, b4, b5, b6, b7)); }
/// <returns>A <see cref="uint"/> representation of the binary data.</returns> public static uint ToUInt32(byte b0, byte b1, byte b2, byte b3) { return(BinaryConversionUtility.ToData <uint>(b0, b1, b2, b3)); }
/// <returns>A <see cref="ushort"/> representation of the binary data.</returns> public static ushort ToUInt16(byte b0, byte b1) { return(BinaryConversionUtility.ToData <ushort>(b0, b1)); }