A
ajfish
Hi,
I have a function func(Stream s) which uses a StreamWriter to write to
the Stream.
It is imperative that the stream remain open after the function has
returned. However, It seems that Close()ing or Dispose()ing a
StreamWriter automatically closes the underlying stream by design.
So is it OK for me to just flush the StreamWriter in the finally
clause of func and never dispose of it ?
I found a post (see below) but it's pretty old so I wondered whether
it is correct and if anything has changed?
http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/80e15ad9afd4fff6
Andy
I have a function func(Stream s) which uses a StreamWriter to write to
the Stream.
It is imperative that the stream remain open after the function has
returned. However, It seems that Close()ing or Dispose()ing a
StreamWriter automatically closes the underlying stream by design.
So is it OK for me to just flush the StreamWriter in the finally
clause of func and never dispose of it ?
I found a post (see below) but it's pretty old so I wondered whether
it is correct and if anything has changed?
http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/80e15ad9afd4fff6
Andy