protected override void Dispose(bool disposing)
{
// Dispose of our resources if this StreamReader is closable.
// Note that Console.In should be left open.
try
{
// Note that Stream.Close() can potentially throw here. So we need to
// ensure cleaning up internal resources, inside the finally block.
if (!LeaveOpen && disposing && (_stream != null))
{
_stream.Close();
}
}
finally
{
if (!LeaveOpen && (_stream != null))
{
_stream = null;
_encoding = null;
_decoder = null;
_byteBuffer = null;
_charBuffer = null;
_charPos = 0;
_charLen = 0;
base.Dispose(disposing);
}
}
}