private ValueTask <FlushResult> WriteToBuff(byte[] buff, SerialPipeWriterAction writeFunc)
        {
            var writer = PipeWriter.Create(new MemoryStream(buff));
            var spw    = new SerialPipeWriter(writer, buff.Length);

            writeFunc(ref spw);
            spw.Dispose();
            return(writer.FlushAsync());
        }
Пример #2
0
 public void WriteToPipe(PipeWriter write)
 {
     using var pw = new SerialPipeWriter(write, 200);
     pw.Write(Text);
 }