Skip to content

Instantly share code, notes, and snippets.

@BanksySan
Last active May 7, 2020 11:38
Show Gist options
  • Save BanksySan/6cea186c03f9fbca894d6f9d41b64f62 to your computer and use it in GitHub Desktop.
Save BanksySan/6cea186c03f9fbca894d6f9d41b64f62 to your computer and use it in GitHub Desktop.
Blog: Writing a Concurrent .NET Stream (2)
var bufferInput = new byte[] {1, 2, 3};
var bufferOutput = new byte[bufferInput.Length];
Console.WriteLine("bufferInput = {0,-2}", string.Join(", ", bufferInput));
Console.WriteLine("bufferOutput = {0,-2}", string.Join(", ", bufferOutput));
var memoryStream = new MemoryStream();
memoryStream.Write(bufferInput, 0, bufferInput.Length);
memoryStream.Read(bufferOutput, 0, bufferInput.Length);
Console.WriteLine("bufferInput = {0}", string.Join(", ", bufferInput));
Console.WriteLine("bufferOutput = {0}", string.Join(", ", bufferOutput));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment