Recurity.Swf.TagHandler.DefineBitsJPEG3.Verify C# (CSharp) Method

Verify() public method

Verifies this object and its components for documentation compliance.
public Verify ( ) : bool
return bool
        public override bool Verify()
        {
            //We do not use System.Drawing.Image here since it is nested in GDI
            MemoryStream ms = new MemoryStream();

            //if jpeg contains erroneous header we fix it
            if (this._imageData[0].Equals(0xff) && this._imageData[1].Equals(0xd9) && this._imageData[2].Equals(0xff) && this._imageData[3].Equals(0xd8))
            {
                ms.Write(this._imageData, 4, this._imageData.Length - 4);
                ms.Seek(0, SeekOrigin.Begin);
            }
            else
            {
                ms.Write(this._imageData, 0, this._imageData.Length);
                ms.Seek(0, SeekOrigin.Begin);
            }
            return true;
        }