title: Byte[stream.length] - out of memory exception, best way to solve?
body: <p>i am trying to read the stream of bytes from a file. However when I try to read the bytes I get a </p>
  
  <blockquote>
    <p>The function evaluation was disabled because of an out of memory
    exception</p>
  </blockquote>
  
  <p>Quite straightforward. However, what is the best way of getting around this problem? Is it too loop around the length at 1028 at a time? Or is there a better way?</p>
  
  <p>The C# I am using </p>
  
  <pre><code>BinaryReader br = new BinaryReader(stream fs);
  
  // The length is around 600000000
  long Length = fs.Length;
  
  // Error here
  bytes = new byte[Length];
  
  for (int i = 0; i &lt; Length; i++)
  {
     bytes [i] = br.ReadByte();
  }
  </code></pre>
  
  <p>Thanks</p>