[Mono-list] [Fwd: [Mono-cvs-list] Mono CVS: mcs gonzalo]

Gonzalo Paniagua Javier gonzalo@gnome-db.org
Wed, 3 Jul 2002 01:32:46 +0200


* [ Mike Kestner <mkestner@speakeasy.net>
* Tue, 02 Jul 2002 23:45:21 +0200 ]
> I think this change is incorrect.  
> 
> If the stream is not seekable, there is no way to back up from the peek,
> and peek is not supposed to consume. Besides, the MS docs on the method
> explicitly state that -1 is supposed to be returned if Peek is called on
> a non-seekable stream.

I was getting an error in a StreamReader that wraps a NetworkStream.

I got a "\r" from StreamReader.ReadLine cause Peek always returned -1
cause you cannot seek a NetworkStream.

With MS runtime, it worked fine, so i supposed they don't check for
CanSeek in StreamReader.Peek (), which does not need any seek operation to
be done, just reading one more char and keep it buffered.

Do you still think that i'm wrong?

-- 
Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
http://www.gnome-db.org/~gonzalo/