using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace skyscraper8.DvbNip
{
	internal class DvbNipUtilities
	{
		private DvbNipUtilities() { }

		private static XmlSerializer multicastGatewayConfigurationXmlSerializer;

		public static MulticastGatewayConfigurationType UnpackMulticastGatewayConfiguration(Stream stream)
		{
			if (multicastGatewayConfigurationXmlSerializer == null)
			{
				multicastGatewayConfigurationXmlSerializer = new XmlSerializer(typeof(MulticastGatewayConfigurationType));
			}

			object v = multicastGatewayConfigurationXmlSerializer.Deserialize(stream);
			MulticastGatewayConfigurationType result = (MulticastGatewayConfigurationType)v;
			return result;
		}
	}
}
