/// <summary> /// Parse the IOP:IOR. /// </summary> /// <param name="byteData">The MPEG2 section containing the IOP:IOR.</param> /// <param name="index">Index of the first byte of the IOP:IOR in the MPEG2 section.</param> public void Process(byte[] byteData, int index) { lastIndex = index; try { typeIDLength = Utils.Convert4BytesToInt(byteData, lastIndex); lastIndex += 4; typeID = Utils.GetString(byteData, lastIndex, typeIDLength); lastIndex += typeIDLength; if ((typeIDLength % 4) != 0) { for (int filler = 0; filler < (4 - (typeIDLength % 4)); filler++) { lastIndex++; } } taggedProfilesCount = Utils.Convert4BytesToInt(byteData, lastIndex); lastIndex += 4; if (taggedProfilesCount != 0) { taggedProfiles = new Collection <BIOPProfileBase>(); while (taggedProfiles.Count != taggedProfilesCount) { BIOPProfileBase taggedProfile = new BIOPProfileBase(); taggedProfile.Process(byteData, lastIndex); taggedProfiles.Add(taggedProfile); lastIndex = taggedProfile.Index; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The IOP:IOR message is short")); } }
/// <summary> /// Parse the IOP:IOR. /// </summary> /// <param name="byteData">The MPEG2 section containing the IOP:IOR.</param> /// <param name="index">Index of the first byte of the IOP:IOR in the MPEG2 section.</param> public void Process(byte[] byteData, int index) { lastIndex = index; try { typeIDLength = Utils.Convert4BytesToInt(byteData, lastIndex); lastIndex += 4; typeID = Utils.GetString(byteData, lastIndex, typeIDLength); lastIndex += typeIDLength; if ((typeIDLength % 4) != 0) { for (int filler = 0; filler < (4 - (typeIDLength % 4)); filler++) lastIndex++; } taggedProfilesCount = Utils.Convert4BytesToInt(byteData, lastIndex); lastIndex += 4; if (taggedProfilesCount != 0) { taggedProfiles = new Collection<BIOPProfileBase>(); while (taggedProfiles.Count != taggedProfilesCount) { BIOPProfileBase taggedProfile = new BIOPProfileBase(); taggedProfile.Process(byteData, lastIndex); taggedProfiles.Add(taggedProfile); lastIndex = taggedProfile.Index; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The IOP:IOR message is short")); } }