Summary
Update the @implSpec
verbiage of java.io.InputStream.skipNBytes()
to match the implementation change to improve performance.
Problem
The implementation is improved to increase the method's performance and the @implSpec
verbiage is no longer accurate.
Solution
Update the @implSpec
verbiage to match the modified implementation.
Specification
Change the @implSpec
verbiage of java.io.InputStream.skipNBytes()
from
If n is zero or negative, then no bytes are skipped. If n is positive, the default implementation of this method invokes skip() with parameter n. If the return value of skip(n) is non-negative and less than n, then read() is invoked repeatedly until the stream is n bytes beyond its position when this method was invoked or end of stream is reached. If the return value of skip(n) is negative or greater than n, then an IOException is thrown. Any exception thrown by skip() or read() will be propagated.
to
If n is zero or negative, then no bytes are skipped. If n is positive, the default implementation of this method invokes skip() repeatedly with its parameter equal to the remaining number of bytes to skip until the requested number of bytes has been skipped or an error condition occurs. If at any point the return value of skip() is negative or greater than the remaining number of bytes to be skipped, then an IOException is thrown. If skip() ever returns zero, then read() is invoked to read a single byte, and if it returns -1, then an EOFException is thrown. Any exception thrown by skip() or read() will be propagated.
- csr of
-
JDK-8246739 InputStream.skipNBytes could be implemented more efficiently
-
- Closed
-