title: StreamReader.ReadToEnd() returning an empty string
body: <p>I have a method</p>
  
  <pre><code>private static String DecompressAndDecode(byte[] data)
  {
     GZipStream decompressor = new GZipStream(new MemoryStream(data), CompressionMode.Decompress);
     StreamReader decompressed = new StreamReader(decompressor, Encoding.UTF8);
     String result = decompressed.ReadToEnd();
     return result;
  }
  </code></pre>
  
  <p>I have some GZipped text as input and the result is supposed to be a String representation of this text. The problem is that the method returns an empty string. What is puzzling me is that when I step trough the method in debug mode and reach the return statement the result variable is an empty string but if I create a watch for the decompressed.ReadToEnd() expression it returns me the text. What I would expect at this point is the result variable  to contain the text and the decompressed.ReadToEnd() expression evaluating to an empty string. (Reevaluating the decompressed.ReadToEnd() expression returns an empty string as expected).</p>
  
  <p><strong>@Edit:</strong> I have found that <em>in my case</em> ReadToEnd() returns the text <em>on the second call</em> returning empty strings on the first call and after the second call.</p>
  
  <p>There must be something obvious I'm missing here.</p>