BUG: BinaryReader.PeekChar on a ResponseStream Always Returns -1 (327266)



The information in this article applies to:

  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.1
  • Microsoft Platform Software Development Kit (SDK) 1.0
  • Microsoft .NET Framework Class Libraries 1.0
  • Microsoft .NET Framework Class Libraries 1.1

This article was previously published under Q327266

SYMPTOMS

The BinaryReader.PeekChar() method always returns -1 on the binary response stream that is returned from HttpWebResponse.GetResponseStream().

CAUSE

BinaryReader.PeekChar() returns the next available character, or returns -1 if no more characters are available or if the stream does not support seeking.

Because the data stream that is returned by HttpWebResponse.GetResponseStream does not support seeking, PeekChar always returns -1 on this stream.

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:10/22/2003
Keywords:kbbug kbFileIO kbKernBase kbpending KB327266 kbAudDeveloper