Recurity.Swf.CwsFile.Write C# (CSharp) Метод

Write() публичный Метод

public Write ( Stream output ) : void
output Stream
Результат void
        public override void Write(Stream output)
        {
            MemoryStream finalContent = new MemoryStream();

            this.FrameHeader.Write(finalContent);
            this.WriteContent.WriteTo(finalContent);
            this.Length = (UInt32)finalContent.Length + 8;

            this.Signature = "CWS";
            byte[] compressedOutput = Compress(finalContent);
            WriteHeader(output);
            output.Write(compressedOutput, 0, compressedOutput.Length);
        }

Usage Example

Пример #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);
     }
 }