Esempio n. 1
0
 /// <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));
     }
 }
Esempio n. 2
0
 /// <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));
     }
 }
Esempio n. 3
0
 /// <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));
     }
 }
Esempio n. 4
0
 /// <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));
     }
 }
Esempio n. 5
0
 /// <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));
     }
 }
Esempio n. 6
0
 /// <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));
     }
 }
Esempio n. 7
0
 /// <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);
 }
Esempio n. 8
0
 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));
 }
Esempio n. 10
0
 /// <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);
 }
Esempio n. 11
0
 /// <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));
 }
Esempio n. 12
0
 /// <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);
 }
Esempio n. 13
0
 /// <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);
 }
Esempio n. 14
0
 /// <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);
 }
Esempio n. 15
0
 /// <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);
 }
Esempio n. 16
0
 /// <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));
 }
Esempio n. 17
0
 /// <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));
 }
Esempio n. 18
0
 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));
 }
Esempio n. 19
0
 public unsafe Binary32(byte *ptr)
 {
     m_data = BinaryConversionUtility.ToData <uint>(*(ptr + 0), *(ptr + 1), *(ptr + 2), *(ptr + 3));
 }
Esempio n. 20
0
 /// <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));
 }
Esempio n. 21
0
 /// <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));
 }