Recurity.Swf.TagHandler.DoAction.WriteCodeAndCheck C# (CSharp) Method

WriteCodeAndCheck() protected method

protected WriteCodeAndCheck ( Stream output ) : void
output Stream
return void
        protected void WriteCodeAndCheck(Stream output)
        {
            long pos = output.Position;

            using (MemoryStream codeContent = RenderCode())
            {
                if (((ulong)codeContent.Length + (ulong)this.CodeOffset) != this.Length)
                {
                    Exception e = new Exception("CRITICAL internal error: generated code length differs from expected length!");
                    Log.Error(this, e);
                    throw e;
                }

                codeContent.WriteTo(output);
            }

            //Log.Debug(this,  ( ( long )( output.Position - pos ) ).ToString( "d" ) + " bytes written" );
        }