title: Writing to stream without file path
body: <p>I have legacy class that writes some results to a file using <code>StreamWriter</code>, created with constructor that accepts <code>FileStream</code>, which is previously created by giving it's constructor a file path:</p>
  
  <pre><code>        using (FileStream fs = File.Open(outputFilePath, FileMode.Create))
          using (StreamWriter sw = new StreamWriter(fs))
          {
              MyFileWriter.WriteToFile(someData, sw);
          }
  </code></pre>
  
  <p>By the way, stated code is used in WCF service.<br>
  Now, I have new requirement where I have to save file to a client file system and I have constraint that I can only send byte[] to client. I would like to make minimal changes to existing code to support this, so is there, for example, some kind of stream which I can create wihtout the need to specify the file path in it's constructor? Later I would convert this stream to <code>byte[]</code>.<br>
   I'm open to any other idea you might have, as well.</p>