When I upgraded to the newest version, I see that the Flush method of the BaseWriter is marked as obsolete. I wondered why I was calling flush explicitly instead of wrapping my writer in a using statement and letting .NET dispose it. Then I saw that I'm explicitly calling Flush because I don't want the underlying stream to be closed on me.
If I were instantiating a StreamWriter myself I would get around this by specifying that I want the base stream to remain open in the StreamWriter's constructor. But it looks like you guys don't have a constructor overload that allows me to pass in a StreamWriter. I assume you guys are constructing a StreamWriter under the covers inside the BaseWriter since your constructor lets us pass in a Stream and an encoding.
Could you add a constructor to the implementations of your writer that either takes in a StreamWriter or else at least lets me specify whether or not I want the stream closed on dispose? In the meantime, I'll just have to live with the little green "obsolete" squiggle... :)
Please sign in to leave a comment.