Re: Using XmlTextWriter without closing the base stream
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: 2 Feb 2006 06:40:32 -0800
Marc Gravell wrote:
<snip>
Forgetting about streams and writers; if I have an object that is a:
disposable and b: I feel ownership for (in particular if I explicitely
created it), then my instinct tells me that I should dispose of that object.
Due to encapsulation, it isn't necessarily my business to know *exactly*
what is going on under the hood, for instance it could be using a windows
handle, a file, a database resource etc - not my problem.
<snip>
I entirely agree. I have my own class which might help you with further
such issues:
NonClosingStreamWrapper, which is in my miscellaneous utility library
(although I note I don't mention it on the front page,
unfortunately...)
http://www.pobox.com/~skeet/csharp/miscutil/
Jon
.
- Follow-Ups:
- Re: Using XmlTextWriter without closing the base stream
- From: Marc Gravell
- Re: Using XmlTextWriter without closing the base stream
- Prev by Date: Re: HttpContext.Current.User is it unique?
- Next by Date: Re: Inconsistent accessibility
- Previous by thread: Re: How to open a second form in a MDI scenario
- Next by thread: Re: Using XmlTextWriter without closing the base stream
- Index(es):
Relevant Pages
|