/// <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="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="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="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="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="int"/> representation of the binary data.</returns> public int ToInt32() { unsafe { fixed(uint *dataPtr = &m_data) return(BinaryConversionUtility.ToData <int>((byte *)dataPtr)); } }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte)"/> public void ExtractBytes(out byte b0, out byte b1) { BinaryConversionUtility.ExtractBytes(m_data, out b0, out b1); }
public unsafe Binary16(byte *ptr) { m_data = BinaryConversionUtility.ToData <ushort>(*(ptr + 0), *(ptr + 1)); }
/// <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)); }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte, out byte, out byte, out byte, out byte, out byte, out byte)"/> public void ExtractBytes(out byte b0, out byte b1, out byte b2, out byte b3, out byte b4, out byte b5, out byte b6, out byte b7) { BinaryConversionUtility.ExtractBytes(m_data, out b0, out b1, out b2, out b3, out b4, out b5, out b6, out b7); }
/// <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)); }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte, out byte, out byte, out byte, out byte, out byte, out byte)"/> public static void GetBytes(double value, out byte b0, out byte b1, out byte b2, out byte b3, out byte b4, out byte b5, out byte b6, out byte b7) { BinaryConversionUtility.ExtractBytes <double>(value, out b0, out b1, out b2, out b3, out b4, out b5, out b6, out b7); }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte, out byte, out byte)"/> public static void GetBytes(float value, out byte b0, out byte b1, out byte b2, out byte b3) { BinaryConversionUtility.ExtractBytes <float>(value, out b0, out b1, out b2, out b3); }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte)"/> public static void GetBytes(ushort value, out byte b0, out byte b1) { BinaryConversionUtility.ExtractBytes <ushort>(value, out b0, out b1); }
/// <inheritdoc cref="BinaryConversionUtility.ExtractBytes{T}(T, out byte, out byte)"/> public static void GetBytes(char value, out byte b0, out byte b1) { BinaryConversionUtility.ExtractBytes <char>(value, out b0, out 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="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)); }
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 Binary32(byte *ptr) { m_data = BinaryConversionUtility.ToData <uint>(*(ptr + 0), *(ptr + 1), *(ptr + 2), *(ptr + 3)); }
/// <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)); }
/// <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)); }