Recurity.Swf.MorphGradient.Parse C# (CSharp) Method

Parse() public method

Parses this object out of a stream
public Parse ( Stream input ) : void
input Stream The stream to read from
return void
        public void Parse(Stream input)
        {
            BinaryReader br = new BinaryReader(input);

            this._numGradients = br.ReadByte();

            if (1 > this._numGradients || 8 < this._numGradients)
            {
                SwfFormatException e = new SwfFormatException("Illegal number of gradients! The number of grad records must be between 1 and 8. This Gradient has " + this._numGradients + " grad records. Skipping.");
                Log.Warn(this, e.Message);
                throw e;
            }

            this._gradientRecords = new MorphGradRecord[this._numGradients];

            for (byte i = 0; i < this._numGradients; i++)
            {
                MorphGradRecord mg = new MorphGradRecord(this._SwfVersion);
                mg.Parse(input);
                this._gradientRecords[i] = mg;
            }
        }