I have the following code. In here I am using the StreamReader
constructor with leaveOpen: true
and in order to do that I need to give the previous parameters which I manage to get their default values. This is cumbersome. Since I use stream
with using
do I gain anything for using the StreamReader
with using
? Does answer change if it is a StreamWriter
instead?
using (Strem stream = ...)
{
...
using (StreamReader sr = new StreamReader(stream, Encoding.UTF8, true, 1024, true))
{
...
}
...
}
What if any do I lose if use the following code instead?
using (Strem stream = ...)
{
...
StreamReader sr = new StreamReader(stream);
...
...
}