RFR: 4890732: GZIPOutputStream doesn't support optional GZIP fields [v9]

Lin Zang lzang at openjdk.java.net
Mon Aug 2 15:03:45 UTC 2021


On Mon, 26 Jul 2021 20:55:00 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> Lin Zang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:
>> 
>>  - change since version to 18
>>  - Merge branch 'master' into gzip-field
>>  - Merge branch 'master' into gzip-field
>>  - Add api in GZIPInputStream to get header data
>>  - Merge remote-tracking branch 'upstream/master' into gzip-field
>>  - remove trailing spaces
>>  - Use record and Builder pattern
>>  - add class GZIPHeaderData, refine testcases
>>  - update copyright
>>  - reuse arguments constructor for non-argument one.
>>  - ... and 3 more: https://git.openjdk.java.net/jdk/compare/e627caec...b1868e8f
>
> src/java.base/share/classes/java/util/zip/GZIPHeaderBuilder.java line 114:
> 
>> 112:      */
>> 113:     public GZIPHeaderBuilder withFileComment(String fileComment) {
>> 114:         if (fileComment == null || fileComment.length() == 0) {
> 
> What happens if the String contains characters outside of ISO_8859_1?

good point! I am not sure whether there should be a check for the characters encoding, I didn't find any implementation that does the check (e.g. the gzip.c implementation) .  But I prefer the idea of checking here, as the specification has defined the encoding.

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

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


More information about the core-libs-dev mailing list