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

Parse() public method

public Parse ( Stream input, byte colorTableSize, UInt32 imageDataSize ) : void
input Stream
colorTableSize byte
imageDataSize System.UInt32
return void
        public virtual void Parse( Stream input, byte colorTableSize, UInt32 imageDataSize )
        {
            //Log.Debug(this, "Image data size is:" + imageDataSize + ". Color table size is: " + colorTableSize  );
            Rgb temp = null;

            for ( byte i = 0; i <= colorTableSize; i++ ) // because we need BitmapColorTableSize + 1 elements
            {
                temp = new Rgb( this._SwfVersion );
                temp.Parse( input );
                _colorTableRGB.Add( temp );
            }

            try
            {
                this._colormapPixelData = new byte[(Int32)imageDataSize];
                input.Read(this._colormapPixelData, 0, (Int32)imageDataSize);
            }
            catch (IndexOutOfRangeException e)
            {
               Log.Error(this, e.Message);
                throw e;
            }
        }