On Mon, 01 Sep 2008 00:01:44 -0700, Marc Gravell <ma**********@gmail.com>
wrote:
I might be wrong, but looking at Red Gate's .NET Reflector [still
getting used to that...] EndOfStream appears to respect the buffer...?
On my computer, using Roeder's Reflection, I see the same thing as you.
If there's data left in the buffer, or refilling the buffer returns a
non-zero number of characters, EndOfStream returns "false". But...
What version of .NET? I'm up-to-date on this computer. Maybe it didn't
used to and the OP is using an earlier version of .NET. The docs
certainly don't guarantee that it does, and in fact seem to me to imply
the opposite. On top of that, it not respecting the buffer is the best
explanation I can come up with for the OP seeing the behavior he's
describing.
I admit, I didn't go over to his office and look over his shoulder to
verify that his code is doing what he says it's doing. But it seems
reasonable to take his word for it. :)
To the OP: if you are using the latest version of .NET, then you should
post a concise-but-complete code sample that demonstrates the problem
because, as Marc points out, the code you posted so far should work fine.
Pete