Recurity.Swf.FwsFile.Write C# (CSharp) Method

Write() public method

public Write ( Stream output ) : void
output System.IO.Stream
return void
        public override void Write( Stream output )
        {
            this.Signature = "FWS";
            this.Length = (uint) (
                WriteContent.Length
                + 3 // signature
                + 1 // version
                + 4 // length
                + FrameHeader.Length
                );
            WriteHeader( output );
            FrameHeader.Write( output );
            WriteContent.WriteTo( output );
        }

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// Writes the contents of this SwfFile instance to a stream. 
 /// Compression is used if configured.
 /// </summary>
 /// <param name="output">The destination stream to write to</param>
 public void Write(Stream output)
 {
     if (SwfFile.Configuration.WriteCompressed)
     {
         CwsFile cws = new CwsFile();
         cws.CompressionLevel = SwfFile.Configuration.WriteCompressionLevel;
         cws.WriteContent = new MemoryStream();
         WriteContent(cws.WriteContent);
         cws.Version = this.Version;
         // copy frame information from old FWS record
         cws.FrameHeader = FwsSource.FrameHeader;
         cws.Write(output);
     }
     else
     {
         FwsFile fws = new FwsFile();
         fws.WriteContent = new MemoryStream();
         WriteContent(fws.WriteContent);
         fws.Version = this.Version;
         // copy frame information from old FWS record
         fws.FrameHeader = FwsSource.FrameHeader;
         fws.Write(output);
     }
 }