using System.IO.Pipelines;
using System.Threading.Tasks;
public static byte[] GetByteArray(int numBytes)
Random rnd = new Random();
byte[] b = new byte[numBytes];
public static async Task Main()
byte[] buffer = GetByteArray(10);
Task readerTask = Task.Factory.StartNew(async () => {
Console.WriteLine("reader end reached");
Console.WriteLine($"writer iteration --> {count}");
await pipe.Writer.WriteAsync(buffer);
buffer = GetByteArray(10);
await pipe.Writer.CompleteAsync();
await Task.Delay(20 * 1000);