Re: StreamWriter closes MemoryStream???

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dennis Myrén (dennis_at_oslokb.no)
Date: 05/14/04


Date: Fri, 14 May 2004 13:58:50 +0200

When calling Close,
the underlying System.IO.Stream is closed.
You should only call Close() on that base stream, when you dont need it
more.

"Bob Rock" <nospam.yet_another_apprentice@hotmail.com> wrote in message
news:%23NnOdhaOEHA.2844@tk2msftngp13.phx.gbl...
> Hello,
>
> I've noticed that after calling the Close method on a StreamWriter, I get
> exceptions on any operation I might request on the associated stream (with
a
> message "Cannot access a closed Stream"). Is this the behaviour I must
> expect? Nothing is said on the documentation.
>
>
> Bob Rock
>
>



Relevant Pages

  • Re: 8ms Timer for serial port access
    ... Then start calling readagain. ... stream of bytes that you acquire by calling read. ... Forget about timing. ... can read and be guaranteed that you have a complete frame). ...
    (comp.os.linux.development.apps)
  • Re: SetPositions() being called at the end of the stream
    ... debugger to see who's calling it. ... quartz.dll is calling this function. ... except at the end of the stream. ... Try putting a breakpoint there and check the call stack in the ...
    (microsoft.public.win32.programmer.directx.video)
  • log4net question
    ... I simply get the stream for the logger and do: ... reader and reading the contents into a string and the string looks correct. ... The problem is, after calling XmlConfigurator.Configure, my log still has ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: StreamWriter closes MemoryStream???
    ... When calling Close, ... You should only call Closeon that base stream, when you dont need it ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: StreamWriter closes MemoryStream???
    ... When calling Close, ... You should only call Closeon that base stream, when you dont need it ...
    (microsoft.public.dotnet.general)