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); }
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)); }
public static byte Get(BasicTypeDeSerializerContext context) { return(context.Retrieve()); }
public static byte Get(BasicTypeDeSerializerContext context) { return context.Retrieve(); }