RFR JDK-7031075: GZIPInputStream's available() reports 1, but read() gives -1.

Pavel Rappo pavel.rappo at oracle.com
Tue Jul 12 22:40:23 UTC 2016


> On 12 Jul 2016, at 23:38, Pavel Rappo <pavel.rappo at oracle.com> wrote:
> 
> Hi Sherman,
> 
> A quick question. Is "inf.finished()" the only condition that needs to be
> checked in order to determine reachEOF? In read(), for instance, they use union:
> 
>    if (inf.finished() || inf.needsDictionary())
>        reachEOF = true;
> 
> Otherwise it seems to me it could be the case that read() returns -1 while
> available() returns 0.

Sorry, available() returns 1.

> Or I am missing something obvious.



More information about the core-libs-dev mailing list