Beispiel #1
0
 /// <summary>
 /// Writes a string representation of this section and its payload to the given text writer.
 /// </summary>
 /// <param name="Writer">
 /// The writer to which a representation of this section is written.
 /// </param>
 /// <remarks>This is the default 'Dump' implementation.</remarks>
 public void DumpNameAndPayload(TextWriter Writer)
 {
     Writer.Write(Name.ToString());
     Writer.Write("; payload length: ");
     using (var memStream = PayloadAsMemoryStream())
     {
         Writer.Write(memStream.Length);
         Writer.WriteLine();
         DumpHelpers.DumpStream(memStream, Writer);
         Writer.WriteLine();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Writes a textual representation of this name entry to the given writer.
 /// </summary>
 /// <param name="Writer">The text writer.</param>
 public virtual void Dump(TextWriter Writer)
 {
     using (var memStream = new MemoryStream())
     {
         using (var binaryWriter = new BinaryWriter(memStream))
         {
             WritePayloadTo(new BinaryWasmWriter(binaryWriter));
             memStream.Seek(0, SeekOrigin.Begin);
             Writer.WriteLine("entry kind '{0}', payload size: {1}", Kind, memStream.Length);
             var instructionWriter = DumpHelpers.CreateIndentedTextWriter(Writer);
             DumpHelpers.DumpStream(memStream, Writer);
         }
     }
 }