title: Convert.ToBase64String throws 'System.OutOfMemoryException' for byte [] (file: large size)
body: <p>I am trying to convert <code>byte[]</code> to <em>base64</em> string format so that i can send that information to third party. My code as below:</p>
  
  <pre><code>byte[] ByteArray = System.IO.File.ReadAllBytes(path);
  string base64Encoded = System.Convert.ToBase64String(ByteArray);
  </code></pre>
  
  <p>I am getting below error:</p>
  
  <blockquote>
    <p>Exception of type 'System.OutOfMemoryException' was thrown. Can you
    help me please ?</p>
  </blockquote>