6516099: InputStream.skipFully(int k) to skip exactly k bytes
Roger.Riggs at oracle.com
Tue Oct 16 19:53:11 UTC 2018
Sorry for the delay in looking at this.
584: Is there really a case where line 585 would throw the exception?
skip(n, true) != n
With the 2nd argument = true, it will either skip the bytes or throw.
I think you can just call: "skip(n, true);
Given subclasses of InputStream that might override skip(n) with a more
would it make sense to implement skipNBytes in terms of skip(n)?
As is, it always uses read() to skip the bytes, which might not be as
efficient as possible
on some streams (for example a very large file) where a seek could be used.
There is a lot of whitespace in this test, spaces before "," and extra
97: "possible result" - does that occur in the tests? The "possible" is
a bit ambiguous especially given the very narrow test case. It would be
useful to include the message from the exception.
On 10/01/2018 05:44 PM, Brian Burkhalter wrote:
> This patch implements a method InputStream.skipNBytes() instead of skipFully() based on the supposition that this name is less likely to conflict with existing subclasses, e.g., . There is some inconsistency however with respect to the description of the method readNBytes() , which may return fewer than N bytes if end of stream is reached first.
> If we converge on a solution in this thread I’ll file a CSR.
>  https://developer.ibm.com/static/site-id/155/maximodev/7609/maximocore/businessobjects/psdi/iface/webservices/action/bytecode/ClassReader.html
>  https://download.java.net/java/early_access/jdk12/docs/api/java.base/java/io/InputStream.html#readNBytes(byte,int,int)
More information about the core-libs-dev