using skyscraper5.Skyscraper.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.DvbNip
{
	internal class NipActualCarrierInformation
	{
		public NipActualCarrierInformation(byte[] buffer)
		{
			MemoryStream ms = new MemoryStream(buffer, false);
			NipNetworkId = ms.ReadUInt16BE();
			NipCarrierId = ms.ReadUInt16BE();
			NipLinkId = ms.ReadUInt16BE();
			NipServiceId = ms.ReadUInt16BE();
			byte reserved = ms.ReadUInt8();
			byte length = ms.ReadUInt8();
			NipStreamProviderName = Encoding.UTF8.GetString(ms.ReadBytes(length));
		}

		public ushort NipNetworkId { get; }
		public ushort NipCarrierId { get; }
		public ushort NipLinkId { get; }
		public ushort NipServiceId { get; }
		public string NipStreamProviderName { get; }
	}
}
