RFR: 8284638: store skip buffers in InputStream Object [v2]

XenoAmess duke at openjdk.java.net
Wed Apr 13 15:12:11 UTC 2022


On Wed, 13 Apr 2022 15:03:22 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> > @AlanBateman You are correct about this. But I wonder if this be a problem, why Reader class can afford store a skip buffer for each Reader.
> > Is there anything different in the situations about skipBuffer in Reader and InputStream?
> 
> Maybe the skip buffer in Reader should be looked at too, esp. as it couldpotentially grow to 16k bytes. The concern with changing InputStream.skip is that there may be a lot more input streams than readers in use, esp. if there is an input stream for every socket connection.

Making a drop of storing skipBuffer in Reader sonds another solution that acceptable to me, as it makes the handling strategy same in Reader and InputStream classes.

> The concern with changing InputStream.skip is that there may be a lot more input streams than readers in use

I don't think use frequency can influence this. In other words, I still think, if there be no special acceptable reason, we shall make the skipBuffer handle strategy same in Reader and InputStream classes.

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

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


More information about the core-libs-dev mailing list