0
1
llucycodes42
In the code above, the System.IO.Stream object is returned that can be used to read data from the stream. Data is read from the beginning of the stream to the position specified, which in this case is the 0th character. The ReadToEnd() method is used to return the data as a string.
Shortcut: ex_stream_to_string
public static string ToString(this System.IO.Stream stream)
{
stream.Position = 0;
return new System.IO.StreamReader(stream).ReadToEnd();
}