RFR: 8264777: Overload optimized FileInputStream::readAllBytes [v5]

Alan Bateman alanb at openjdk.java.net
Thu May 6 13:49:51 UTC 2021


On Tue, 4 May 2021 20:13:20 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> On `/proc/cpuinfo` for example, `fstat()` succeeds but `st_size` in `struct stat` is zero. The correct position is however returned by `lseek()`. Apparently this proposal needs to be reworked to expect size zero when the size is in fact non-zero.
>
> Updated to handle `length() == 0` case. Not sure however whether for this case it might not be better just to fall back to `super.readXBytes()` instead.

Can you rename the native length and position methods to length0 and position0 as we will need to wrap these methods later. Also it will keep them consistent with RAF.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3845


More information about the core-libs-dev mailing list