On Wed, 13 Apr 2022 14:56:12 GMT, XenoAmess <d...@openjdk.java.net> wrote:

>> @jmehrens what about this then?
>> I think it safe now(actually this mechanism is learned from Reader)
> XenoAmess has updated the pull request incrementally with one additional 
> commit since the last revision:
>   moving nr declaration from the beginning of the method to where it's 
> actually used

I'd be a quite cautious about the slippery slope of incremental change with 
very little measurable benefit.
Most applications reading InputStreams or Readers are using the buffered 
versions that already
handle skip. These are the fallback versions.
Except for the buffered versions, the lower level InputStreams can do a better 
job of skip
then at the higher level built on read().  FileInputStream directly uses seek, 
other direct streams
can probably do a more efficient skip() by reading into private buffers. For 
example low level I/O for networking already reads into private buffers.  But 
the dominate case is still the buffered streams and readers.


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

Reply via email to