public object Deserialize(byte[] buffer) { _currentTime = BitConverter.ToLong(buffer, 0); _gyroAxes.Pitch = BitConverter.ToFloat(buffer, 8); _gyroAxes.Roll = BitConverter.ToFloat(buffer, 12); _gyroAxes.Yaw = BitConverter.ToFloat(buffer, 16); _radioAxes.Pitch = BitConverter.ToFloat(buffer, 20); _radioAxes.Roll = BitConverter.ToFloat(buffer, 24); _radioAxes.Yaw = BitConverter.ToFloat(buffer, 28); _pidAxes.Pitch = BitConverter.ToFloat(buffer, 32); _pidAxes.Roll = BitConverter.ToFloat(buffer, 36); _pidAxes.Yaw = BitConverter.ToFloat(buffer, 40); return(this); }
/// <summary> /// Reads a 64-bit signed integer from the stream, using the bit converter /// for this reader. 8 bytes are read. /// </summary> /// <returns>The 64-bit integer read</returns> public long ReadLong() { ReadInternal(buffer, 8); return(BitConverter.ToLong(buffer, 0)); }