On Wed, 7 Jan 2026 15:43:06 GMT, Lance Andersen <[email protected]> wrote:
>> Jaikiran Pai has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> use -1 to represent absence of a GZIP header, from readHeader() method
>
> src/java.base/share/classes/java/util/zip/GZIPInputStream.java line 219:
>
>> 217: } else {
>> 218: magic = readUShort(in);
>> 219: }
>
> Understand what you are doing but perhaps consider adding more clarity to the
> comments as you are now cobbling together the int which should contain the
> GZIP header magic number
Do you mean additional comments for the enclosing `if` block? That piece of
code is the same as what's currently present in the implementation of
`readUShort(...)` except that we won't throw a `EOFException`. Would an
additional comment like this be good:
// read an unsigned short value representing the GZIP magic header.
// this is the same as calling readUShort(in), except that here,
// when reading the first byte, we don't raise an EOFException
// if the stream has already reached EOF.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29092#discussion_r2672133418