title: Maximum length of byte[]?
body: <p>I'm trying to create an array of <code>byte</code>s whose length is <code>UInt32.MaxValue</code>. This array is essentially a small(ish) in-memory database:</p>
  
  <pre><code>byte[] countryCodes = new byte[UInt32.MaxValue];
  </code></pre>
  
  <p>On my machine, however, at run-time, I get a <code>System.OverflowException</code> with "Arithmetic operation resulted in an overflow".</p>
  
  <p>What's the deal? Do I need to use an <code>unsafe</code> block and <code>malloc</code>? How would I do that in C#?</p>