Extension method that writes to a stream
Your questions imply that you might not be quite aware of how streams or references work in C#. 


You pass in a reference to a Stream
You create a StreamWriter which writes to that Stream
This will automatically make changes visible to anyone holding a reference to the same Stream.


Therefor there is no need to try and return the Stream in any way from the method to make the changes visible to the caller - you just need to write to it. This is at least how I interpret your questions.

However there is a catch in your implementation: disposing the StreamWriter will automatically close the underlying Stream which I find hugely annoying at times.  Only since .NET 4.5 there is a constructor for StreamWriter which allows you to leave the Stream open. So right now your extension method will close the Stream which I guess is not the intention. Your only option to avoid that is to use .NET 4.5 or do not wrap the StreamWriter in a using statement.