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

(spec) Inconsistency between {ObjectInputStream,DataInput}.skipBytes and EOFException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 5.0
    • core-libs
    • b23
    • x86
    • windows_xp
    • Verified

      Specification for ObjectInputStream states:

      "
      Class ObjectInputStream
      ...
      All Implemented Interfaces:
      ...
      DataInput
      ...
      public int skipBytes(int len) throws IOException

      Skips bytes, block until all bytes are skipped.

      Specified by:
      skipBytes in interface DataInput
      ...
      Throws:
      EOFException - If end of file is reached.
      ...
      "

      but specification for method skipBytes in interface java.io.DataInput states:

      "
      int skipBytes(int n) throws IOException

      Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes. However, it may skip over some smaller number of bytes, possibly zero. This may result from any of a number of conditions; reaching end of file before n bytes have been skipped is only one possibility. This method ___NEVER___ throws an EOFException. The actual number of bytes skipped is returned.
      "

      Specification for ObjectInputStream.skipBytes should be corrected to comply to specification for DataInput.skipBytes.
      ###@###.### 2004-12-27 19:34:13 GMT

            iris Iris Clark
            idergali Ilya Dergalin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: