System.Action.Invoke(Writer)

Here are the examples of the csharp api System.Action.Invoke(Writer) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : Module.cs
with Apache License 2.0
from RyanLamansky

static void WriteSection(byte[] buffer, Writer writer, Section section, Action<Writer> action)
        {
            writer.Write((byte)section);
            using var memory = new MemoryStream();
            using (var sectionWriter = new Writer(memory))
            {
                action(sectionWriter);
            }

            writer.WriteVar(checked((uint)memory.Length));
            memory.Position = 0;
            int read;
            while ((read = memory.Read(buffer, 0, buffer.Length)) > 0)
                writer.Write(buffer, 0, read);
        }