Stream C# Book

using System;
using System.IO;
using System.IO.MemoryMappedFiles;
using System.Linq;
using System.Text;
class Program
{
static void Main()
{
File.WriteAllBytes("long.bin", new byte[100]);
using (MemoryMappedFile mmf = MemoryMappedFile.CreateFromFile("long.bin"))
using (MemoryMappedViewAccessor accessor = mmf.CreateViewAccessor())
{
accessor.Write(5, (byte)77);
Console.WriteLine(accessor.ReadByte(5)); // 77
}
}
}