Last active
May 7, 2020 11:38
-
-
Save BanksySan/6cea186c03f9fbca894d6f9d41b64f62 to your computer and use it in GitHub Desktop.
Blog: Writing a Concurrent .NET Stream (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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