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).
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).
- csr for
-
JDK-8261618 Clarify Reader.skip behavior for end of stream
-
- Closed
-
- relates to
-
JDK-8258444 Clean up specifications of java.io.Reader.read(char[],int,int) in subclass overrides
-
- Resolved
-