On Thu, 24 Oct 2024 14:00:39 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> readAllBytes reads to EOF so there isn't any benefit to caching. I think the >> main thing with this PR is whether canSeek is the right thing to use. > > Hello Alan, I didn't just mean the readAllBytes. The rest of the changes in > this PR calls canSeek() even in readNBytes() and skip() implementations which > may not be reading till EOF and in theory could be invoked multiple times. > Having said that, the proposal to cache was merely a suggestion. I don't have > any data to suggest if these methods are called frequent enough to have the > additional native call show up prominently in that call path. > [...] do you think we should reduce these native calls in this change and > call `canSeek()` just once [...] I think that is a good idea but I would think it best to do i in a similar way to the recent change to `ChannelInputStream` that added `isOther`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21673#discussion_r1815201732