Example #1
0
        /// <summary>
        /// Parse the module.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the module.</param>
        /// <param name="index">Index of the first byte of the module in the MPEG2 section.</param>
        public void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                moduleID   = Utils.Convert2BytesToInt(byteData, lastIndex);
                lastIndex += 2;

                moduleSize = Utils.Convert4BytesToInt(byteData, lastIndex);
                lastIndex += 4;

                moduleVersion = (int)byteData[lastIndex];
                lastIndex++;

                moduleInfoLength = (int)byteData[lastIndex];
                lastIndex++;

                if (moduleInfoLength != 0)
                {
                    biopModuleInformation = new BIOPModuleInfo();
                    biopModuleInformation.Process(byteData, lastIndex);
                    lastIndex = biopModuleInformation.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The DSMCC Download Info Indication Module message is short"));
            }
        }
        /// <summary>
        /// Parse the module.
        /// </summary>
        /// <param name="byteData">The MPEG2 section containing the module.</param>
        /// <param name="index">Index of the first byte of the module in the MPEG2 section.</param>
        public void Process(byte[] byteData, int index)
        {
            lastIndex = index;

            try
            {
                moduleID = Utils.Convert2BytesToInt(byteData, lastIndex);
                lastIndex += 2;

                moduleSize = Utils.Convert4BytesToInt(byteData, lastIndex);
                lastIndex += 4;

                moduleVersion = (int)byteData[lastIndex];
                lastIndex++;

                moduleInfoLength = (int)byteData[lastIndex];
                lastIndex++;

                if (moduleInfoLength != 0)
                {
                    biopModuleInformation = new BIOPModuleInfo();
                    biopModuleInformation.Process(byteData, lastIndex);
                    lastIndex = biopModuleInformation.Index;
                }

                Validate();
            }
            catch (IndexOutOfRangeException)
            {
                throw (new ArgumentOutOfRangeException("The DSMCC Download Info Indication Module message is short"));
            }
        }