Esempio n. 1
0
 public static unsafe float Get(BasicTypeDeSerializerContext context, float data)
 {
     var temp = new byte[4];
     if (context.IsLittleEndian) {
         // Reverse the buffer going from Big Endian (network byte order) to Little Endian
         temp[3] = context.Retrieve();
         temp[2] = context.Retrieve();
         temp[1] = context.Retrieve();
         temp[0] = context.Retrieve();
     } else { // Already in Big Endian format
         temp[0] = context.Retrieve();
         temp[1] = context.Retrieve();
         temp[2] = context.Retrieve();
         temp[3] = context.Retrieve();
     }
     UInt32 value = Utility.ExtractValueFromArray(temp, 0, 4);
     return *((float*)&value);
 }
Esempio n. 2
0
        public static unsafe float Get(BasicTypeDeSerializerContext context, float data)
        {
            var temp = new byte[4];

            if (context.IsLittleEndian)
            {
                // Reverse the buffer going from Big Endian (network byte order) to Little Endian
                temp[3] = context.Retrieve();
                temp[2] = context.Retrieve();
                temp[1] = context.Retrieve();
                temp[0] = context.Retrieve();
            }
            else     // Already in Big Endian format
            {
                temp[0] = context.Retrieve();
                temp[1] = context.Retrieve();
                temp[2] = context.Retrieve();
                temp[3] = context.Retrieve();
            }
            UInt32 value = Utility.ExtractValueFromArray(temp, 0, 4);

            return(*((float *)&value));
        }
Esempio n. 3
0
 public static byte Get(BasicTypeDeSerializerContext context)
 {
     return(context.Retrieve());
 }
Esempio n. 4
0
 public static byte Get(BasicTypeDeSerializerContext context)
 {
     return context.Retrieve();
 }