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

InputStream documentation for IOException in skip() is unclear or incorrect

XMLWordPrintable

    • b125
    • generic
    • generic
    • Not verified

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      The documentation for java.io.InputStream.skip(long) states:

      "The skip method of this class creates a byte array and then repeatedly reads into it until n bytes have been read or the end of the stream has been reached. Subclasses are encouraged to provide a more efficient implementation of this method. For instance, the implementation may depend on the ability to seek."

      but for IOException, it says it is thrown "if the stream does not support seek, or if some other I/O error occurs."

      The description of the default implementation seems to say that the default implementation will not use seek, and to imply that subclass implementations should work regardless of whether or not seek() is supported, but if supported use it for greater efficiency.



      REPRODUCIBILITY :
      This bug can be reproduced always.

            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: