RFR: 8259956: jdk.jfr.internal.ChunkInputStream#available should return the sum of remaining available bytes
Erik Gahlin
egahlin at openjdk.java.net
Mon Feb 1 08:49:42 UTC 2021
On Wed, 20 Jan 2021 03:40:19 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> Hi Denghui,
>>
>> Looks reasonable, but I will do a proper review of this and your other PRs once everything is set for JDK 16.
>>
>> Erik
>
>> Hi Denghui,
>>
>> Looks reasonable, but I will do a proper review of this and your other PRs once everything is set for JDK 16.
>>
>> Erik
>
> okay, thanks :)
Not sure things should be changed. Javadoc for Inputstream::available() says:
"Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream."
How often the stream will block depends on the underlying BufferInputStream, so it seems correct to just delegate. Purpose of the available() method is not to return the total.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2138
More information about the hotspot-jfr-dev
mailing list