6516099: InputStream.skipFully(int k) to skip exactly k bytes

Brian Burkhalter brian.burkhalter at oracle.com
Wed Nov 21 17:19:07 UTC 2018


Hello, again,

In response to comments on the CSR

https://bugs.openjdk.java.net/browse/JDK-8214072

the following change to the verbiage is proposed:

--- a/src/java.base/share/classes/java/io/InputStream.java
+++ b/src/java.base/share/classes/java/io/InputStream.java
@@ -562,7 +562,8 @@
      * in an inconsistent state. It is strongly recommended that the
      * stream be promptly closed if an I/O error occurs.
      *
-     * <p> Subclasses are encouraged to provide a more efficient implementation
+     * @implNote
+     * Subclasses are encouraged to provide a more efficient implementation
      * of this method.
      *
      * @implSpec
@@ -572,7 +573,8 @@
      * then {@link #read()} is invoked repeatedly until the stream is {@code n}
      * bytes beyond its position when this method was invoked or end of stream
      * is reached.  If the return value of {@code skip(n)} is negative or
-     * greater than {@code n}, then an {@code IOException} is thrown.
+     * greater than {@code n}, then an {@code IOException} is thrown.  Any
+     * exception thrown by {@code skip()} or {@code read()} will be propagated.
      *
      * @param      n   the number of bytes to be skipped.
      * @throws     EOFException if end of stream is encountered before the

Thanks,

Brian

> On Nov 16, 2018, at 5:25 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> So updated in place.
> 
> http://cr.openjdk.java.net/~bpb/6516099/webrev.07/ <http://cr.openjdk.java.net/~bpb/6516099/webrev.07/>


More information about the core-libs-dev mailing list