/// <summary> /// Parse the descriptor. /// </summary> /// <param name="byteData">The MPEG2 section containing the descriptor.</param> /// <param name="index">Index of the byte in the MPEG2 section following the descriptor length.</param> internal override void Process(byte[] byteData, int index) { lastIndex = index; region = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; try { if (Length != 2) { channelInfoEntries = new Collection <OpenTVChannelInfoEntry>(); int length = Length - 2; while (length > 0) { OpenTVChannelInfoEntry channelInfoEntry = new OpenTVChannelInfoEntry(); channelInfoEntry.Process(byteData, lastIndex); channelInfoEntries.Add(channelInfoEntry); lastIndex += channelInfoEntry.Length; length -= channelInfoEntry.Length; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The Open TV Channel Info Descriptor message is short")); } }
/// <summary> /// Parse the descriptor. /// </summary> /// <param name="byteData">The MPEG2 section containing the descriptor.</param> /// <param name="index">Index of the byte in the MPEG2 section following the descriptor length.</param> internal override void Process(byte[] byteData, int index) { lastIndex = index; region = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; try { if (Length != 2) { channelInfoEntries = new Collection<OpenTVChannelInfoEntry>(); int length = Length - 2; while (length > 0) { OpenTVChannelInfoEntry channelInfoEntry = new OpenTVChannelInfoEntry(); channelInfoEntry.Process(byteData, lastIndex); channelInfoEntries.Add(channelInfoEntry); lastIndex += channelInfoEntry.Length; length -= channelInfoEntry.Length; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The Open TV Channel Info Descriptor message is short")); } }