title: Is it necessary to nest usings with IDisposable objects?
body: <p>Do I have to wrap all my <code>IDisposable</code> objects in <code>using(){}</code> statements, even if I'm just passing one to another?  For example, in the following method:</p>
  
  
  
  <pre class="lang-cs prettyprint-override"><code>public static string ReadResponse(HttpWebResponse response)
  {
      string resp = null;
      using (Stream responseStream = response.GetResponseStream())
      {
          using (StreamReader responseReader = new StreamReader(responseStream))
          {
              resp = responseReader.ReadToEnd();
          }
      }
      return resp;
  }
  </code></pre>
  
  <p>Could I consolidate this to just one <code>using</code> like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public static string ReadResponse(HttpWebResponse response)
  {
      string resp = null;
      using (StreamReader reader = new StreamReader(response.GetResponseStream()))
      {
          resp = reader.ReadToEnd();
      }
      return resp;
  }
  </code></pre>
  
  <p>Can I count on both the <code>Stream</code> and the <code>StreamReader</code> being disposed?  Or do I have to use two <code>using</code> statements?</p>