title: How to get a MemoryStream from a Stream in .NET?
body: <p>I have the following constructor method which opens a <code>MemoryStream</code> from a file path:</p>
  
  <pre><code>MemoryStream _ms;
  
  public MyClass(string filePath)
  {
      byte[] docBytes = File.ReadAllBytes(filePath);
      _ms = new MemoryStream();
      _ms.Write(docBytes, 0, docBytes.Length);
  }
  </code></pre>
  
  <p>I need to change this to accept a <code>Stream</code> instead of a file path. Whats the easiest/most efficient way to get a <code>MemoryStream</code> from the <code>Stream</code> object?</p>