Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4178064

java.io.FileInputStream.skip returns incorrect result at EOF

XMLWordPrintable

    • x86
    • windows_nt, windows_2000



      Name: mr33420 Date: 10/01/98


      Start reading a file byte-by-byte. Once you reach
      end-of-file, give inputStream.skip(5) (to skip 5 bytes).
      Instead of returning -1 (since no bytes can be
      skipped), skip(long) returns the actual bytes
      asked to skip (in this case 5 bytes).
      Since skip(long) does not return -ve number, I
      tried to read from file (and have not closed the file yet)
      Read method returns -1 which specifies that EOF is
      really reached. Isn't this bug related to skip method ?
      (Review ID: 38778)
      ======================================================================

            mmcclosksunw Michael Mccloskey (Inactive)
            mr Mark Reinhold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: