C Sharp (C#) - File IO
What will be the output of the following C# code?
using System;
using System.IO;
class Program {
static void Main() {
using (var fs = new FileStream("test.txt", FileMode.Create)) {
byte[] data = {72, 105};
fs.Write(data, 0, data.Length);
}
using (var fs = new FileStream("test.txt", FileMode.Open)) {
byte[] buffer = new byte[2];
fs.Read(buffer, 0, buffer.Length);
Console.WriteLine(System.Text.Encoding.ASCII.GetString(buffer));
}
}
}