Example #1
0
    /// <summary>
    /// Reads a route in IOF XML 3.0 binary format from a stream.
    /// </summary>
    /// <param name="stream">The stream to read from.</param>
    public static IofXml30Route FromStream(Stream stream)
    {
        var waypoints = new List <IofXml30Waypoint>();

        while (stream.Position < stream.Length)
        {
            waypoints.Add(IofXml30Waypoint.FromStream(stream, waypoints.LastOrDefault()));
        }
        return(new IofXml30Route()
        {
            Waypoints = waypoints
        });
    }