eof

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SnVhbiBNYXJjaWFs?=

    eof

    does how to know end of file (eof) while reading a binary stream that does
    not support seeking?

    that is, is not valid:
    while (br.PeekChar() 0) { ... }


    --
    Juan Marcial
    Ingeniero de Software
  • =?UTF-8?B?QXJuZSBWYWpow7hq?=

    #2
    Re: eof

    Juan Marcial wrote:
    does how to know end of file (eof) while reading a binary stream that does
    not support seeking?
    >
    that is, is not valid:
    while (br.PeekChar() 0) { ... }
    Any Read method and test on return status. Read() returns -1 if
    EOF.

    Arne

    Comment

    • Peter Duniho

      #3
      Re: eof

      On Sat, 23 Feb 2008 08:24:35 -0800, Arne Vajhøj <arne@vajhoej.d kwrote:
      Any Read method and test on return status. Read() returns -1 if
      EOF.
      It returns 0 at the end-of-stream, actually. But yes, checking the return
      value from the Read() method is the correct way.

      Pete

      Comment

      • =?UTF-8?B?QXJuZSBWYWpow7hq?=

        #4
        Re: eof

        Peter Duniho wrote:
        On Sat, 23 Feb 2008 08:24:35 -0800, Arne Vajhøj <arne@vajhoej.d kwrote:
        >Any Read method and test on return status. Read() returns -1 if
        >EOF.
        >
        It returns 0 at the end-of-stream, actually. But yes, checking the
        return value from the Read() method is the correct way.
        Docs says:

        #Return Value
        #The next character from the input stream, or -1 if no characters are
        #currently available.

        Arne

        Comment

        Working...