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

Clarify Reader.skip behavior for end of stream

XMLWordPrintable

    • b11
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      The documentation for java.io.Reader.skip current says
      >Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached.

      However, it is not directly clear what the behavior will be in case the end of stream is reached:
      - Is 0 returned because no character has been skipped?
      - Is -1 returned similar to read()?
      - Is an EOFException thrown?

      It would be good to explicitly specify the behavior (which seems to be returning 0).


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

              Created:
              Updated:
              Resolved: