Is there any way to close a StreamWriter without closing its BaseStream?
If you are using .NET Framework 4.5 or later, there is a StreamWriter overload using which you can ask the base stream to be left open when the writer is closed. In earlier versions of .NET Framework prior to 4.5, StreamWriter assumes it owns the stream. Options: Don’t dispose the StreamWriter; just flush it. Create … Read more