title: Is there a restriction on the amount of text I can write / read with a stream writer / reader in C#?
body: <p>I am trying to write to some text file using a stream writer. 
  the text I am trying to write is from a different text file.</p>
  
  <p>I try:</p>
  
  <pre><code>string line = reader.ReadLine(); //reader is a streamReader I defined before
  while (line != null)
  {
      sw.WriteLine(line); //sw is a streamWriter I defined before
      line = reader.ReadLine();
  }
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>while (!(reader.EndOfStream))
  {
      sw.WriteLine(reader.ReadLine()); //sw is a streamWriter I defined before
  }
  </code></pre>
  
  <p>this two methods succeeded to copy the text from the file to the other file, but from some reason not all of the text was copied. 
  The text file I am trying to copy from is very large, about 96000 lines, and only the ~95000 first lines are copied. </p>
  
  <p>Therfore, I am asking if there is a restriction on the amount of text I can write / read with a stream writer / reader in C#?</p>
  
  <p>Also, I asking for some suggestions for how to succeed copy all the text.
  (I read that there is a method copy of the Stream class, but that is for .NET4, so it wont help).</p>
  
  <p><strong>EDIT:</strong> I tried to replace the text in the end that didn't copied by a text form the start that was copied. I got the same problem, so it isn't a problem with the characters. </p>