title: TidHttp file download trows Out of memory Exception
body: <p>Consider the follow code that downloads a file from internet using Indy components:</p>
  
  <pre><code>procedure TForm26.Button1Click(Sender: TObject);
  var
    vFileStream : TStream;
  begin
    DeleteFile('C:\test.exe');
    vFileStream := TFileStream.Create('C:\test.exe', fmCreate);
    IdHTTP1.Get('SomeUrl', vFileStream);
    vFileStream.Free;
  end;
  </code></pre>
  
  <p>I am getting an Out Of memory exception. What is happening is that besides the fact that I am using <code>TFileStream</code>, the bytes that are being written to it do not go directly to the disk, instead, they stay in memory until <code>get</code> terminates.</p>
  
  <p>The file I am trying to download is really, really big.</p>
  
  <p>Does anyone knows how to download a big file without getting an out of memory exception?</p>
  
  <p>Delphi 2010 and latest Indy 10 from Indy's SVN.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>That is not a <code>FileStream</code> problem. It is a <code>Indy</code> problem. Indy is, somehow, caching the file in memory before it writes to the stream.</p>