public override int Deserialize(System.Byte[] serialized, int startIndex) { int curIndex = startIndex; System.UInt32 positions_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(positions_len).Length; for (int i = 0; i < (int)positions_len; i++) { double element = BitConverter.ToDouble(serialized, curIndex); curIndex += BitConverter.GetBytes(element).Length; positions.Add(element); } System.UInt32 velocities_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(velocities_len).Length; for (int i = 0; i < (int)velocities_len; i++) { double element = BitConverter.ToDouble(serialized, curIndex); curIndex += BitConverter.GetBytes(element).Length; velocities.Add(element); } System.UInt32 accelerations_len = BitConverter.ToUInt32(serialized, curIndex); curIndex += BitConverter.GetBytes(accelerations_len).Length; for (int i = 0; i < (int)accelerations_len; i++) { double element = BitConverter.ToDouble(serialized, curIndex); curIndex += BitConverter.GetBytes(element).Length; accelerations.Add(element); } curIndex += time_from_start.Deserialize(serialized, curIndex); return(curIndex - startIndex); }
public override int Deserialize(System.Byte[] serialized, int startIndex) { int curIndex = startIndex; curIndex += data.Deserialize(serialized, curIndex); return(curIndex - startIndex); }