The following classes from mscorelib closes(dispose the given resources on exit
y System.IO.BinaryReader(Stream input,Encoding encoding,Boolean leaveOpen);
y System.IO.BinaryWriter(Stream output,Encoding encoding,Boolean leaveOpen);
n System.IO.BufferedStream
n System.IO.FileStream
y System.IO.StreamReader(Stream stream,Encoding encoding,Boolean detectEncodingFromByteOrderMarks,Int32 bufferSize,Boolean leaveOpen);
y System.IO.StreamWriter(Stream stream,Encoding encoding,Int32 bufferSize,Boolean leaveOpen);
n System.Security.Cryptography.CryptoStream
n System.Resources.ResourceReader(Stream stream);
n System.Resources.ResourceSet(Stream stream);
n System.Resources.ResourceSet(IResourceReader reader);
n System.Resources.ResourceWriter(Stream stream);
The classes with prefix y allow to control the closing behaviour via an bool leaveOpen flag in ctor.
The following classes from mscorelib closes(dispose the given resources on exit y System.IO.BinaryReader(Stream input,Encoding encoding,Boolean leaveOpen); y System.IO.BinaryWriter(Stream output,Encoding encoding,Boolean leaveOpen); n System.IO.BufferedStream n System.IO.FileStream y System.IO.StreamReader(Stream stream,Encoding encoding,Boolean detectEncodingFromByteOrderMarks,Int32 bufferSize,Boolean leaveOpen); y System.IO.StreamWriter(Stream stream,Encoding encoding,Int32 bufferSize,Boolean leaveOpen); n System.Security.Cryptography.CryptoStream n System.Resources.ResourceReader(Stream stream); n System.Resources.ResourceSet(Stream stream); n System.Resources.ResourceSet(IResourceReader reader); n System.Resources.ResourceWriter(Stream stream);
The classes with prefix y allow to control the closing behaviour via an bool leaveOpen flag in ctor.