title: Will a C# MemoryMappedFile expand?
body: <p>I am using a <code>MemoryMappedFile</code> to exchange data between two processes. So I created/opened the file like this in both processes:</p>
  <pre><code>MemoryMappedFile m_MemoryMappedFile = MemoryMappedFile.CreateOrOpen(&quot;Demo&quot;, 8);
  </code></pre>
  <p>The file access itself is protected with a global mutex in both processes. Now when I write data to the file which is bigger than the defined length of 8 bytes I do <strong>NOT</strong> get an exception.</p>
  <pre><code>var random = new Random();
  var testData = new byte[55];
  random.NextBytes(testData);
  using (var contentAccessor = m_MemoryMappedFile.CreateViewStream())
  {
      contentAccessor.Write(testData, 0, testData.Length);
  }
  </code></pre>
  <p>So perhaps I am getting something wrong here, but I thought if I create a non persistent memory mapped file with a specified capacity (in my case 8 bytes) it is not allowed to write more data than 8 bytes? Or do I corrupt the memory with my call above? Any explanation would be great?</p>