I have an input stream wrapped in a System.IO.StreamReader... I wish to write the content of the stream to a file (i.e. StreamWriter).
The length of the inputstream is unknown. Could be a few bytes and to gigabytes in length.
How is this done the easiest that does not take up too much memory?
Something like this:
Note that this is very similar to what you'd write to copy the contents of one stream to another - this just happens to be text data instead of binary data.