title: how to copy one Stream object values to second Stream Object in asp.net
body: <p>In my project user can upload file up to 1GB. I want to copy that uploaded file stream data to second stream. 
  If I use like this</p>
  
  <pre><code>int i;
  while ( ( i = fuVideo.FileContent.ReadByte() ) != -1 )
  {
    strm.WriteByte((byte)i);
  }
  </code></pre>
  
  <p>then it is taking so much time.</p>
  
  <p>If i try to do this by byte array then I  need to add array size in long which is not valid.</p>
  
  <p>If someone has better idea to do this then please let me know.</p>
  
  <p>--</p>
  
  <p>Hi Khepri thanks for <a href="https://stackoverflow.com/questions/6261106/how-to-copy-one-stream-object-values-to-second-stream-object-in-asp-net/6261133#6261133">your response</a>. I tried <code>Stream.Copy</code> but it is taking so much time to copy one stream object to second.</p>
  
  <p>I tried with 8.02Mb file and it took 3 to 4 minutes.
  The code i have added is </p>
  
  <pre><code>Stream fs = fuVideo.FileContent;  //fileInf.OpenRead();
  
  Stream strm = ftp.GetRequestStream();
  fs.CopyTo(strm);
  </code></pre>
  
  <p>If i am doing something wrong then please let me know.</p>