-
-
Save drch-/25eb147ef11305171b20 to your computer and use it in GitHub Desktop.
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var fileStream = new FileStream(@"c:\temp\test.txt", FileMode.Open)) | |
using (var memoryStream = new MemoryStream()) | |
{ | |
fileStream.CopyTo(memoryStream); | |
byte[] data = memoryStream.ToArray(); | |
Console.WriteLine("Read " + data.Length + " bytes"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment