Reading file contents into a string Option 1 - nice and simple

private void GetFileReady()
{
    private StringBuilder fileContents = new StringBuilder();
    using (var sr = new StreamReader("C:\A big file.txt"))
    {
        fileContents.Append(sr.ReadToEnd());              
    }
}


Option 2 - less simple

private void GetFileReady2()
{
   private StringBuilder fileContents = new StringBuilder();
   const int bufferSize = 1024;
   var buffer = new Char[bufferSize];
   var count = bufferSize;

   using (var sr = new StreamReader("C:\A big file.txt"))
   {                
       while (count &gt; 0)
       {
           count = sr.Read(buffer, 0, bufferSize);
           fileContents.Append(buffer, 0, count);
       }
   }
}


Would option 2 be better for something esoteric like memory allocation?
Is the goal to get a string containing the content of the file? or to add the content of a file to an existing StringBuilder?

if it's the former then Option 1 can drop the string builder altogether ... or better yet.

string value = File.ReadAllText("C:\A big file.txt");


if it's the latter then you might want to think about using StringBuilder.EnsureCapacity() to avoid the overhead of resizing the buffer more then it needs to.