Codereview request for 7188852: Move implementation of De/Inflater.getBytesRead/Writtten() to java from native

Xueming Shen xueming.shen at
Fri Aug 3 18:45:23 UTC 2012

Just tried to leave the "trace" of the change. But I'm fine to just keep
the "changes" from original zlib source.

Webrev has been updated accordingly.


On 08/03/2012 11:16 AM, Alan Bateman wrote:
> On 02/08/2012 22:59, Xueming Shen wrote:
>> Hi
>> This is the change to move the implementation of 
>> De/Inflater.getBytesRead/Written()
>> from native to Java. Current JDK implementation uses zlib's 
>> z_stream.total_in/out fields,
>> which are "uLong" type in original zlib source code. This may limit 
>> these two counters
>> to 4GB on 32-bit OS [1].  These two fields are currently patched to 
>> "long long" in JDK to
>> support the > 4G counting. It is suggested that it might be better to 
>> move this > 4G
>> counting support to java level to remove the dependency on patching 
>> the original zlib
>> source code, which might be critical in situation that Java runtime 
>> prefers to use OS
>> bundled zlib, instead of the JDK bundled zlib library.
>> Here is the webrev
>> The test case attached only tests upto 128M by default (for running 
>> in auto testing).
>> The test can be run manually with option "large" to test > 4G 
>> de/inflating. It takes > 4
>> minutes to compress/decompress 5G bytes on my linux box, guess it's 
>> probably not
>> desirable to hold each/every run for so long in auto setting.
> I skimmed through this and the changes looks reasonable to me. The 
> only thing is that ChangeLog_java is a bit confusing (to me anyway) 
> and maybe it would be clearer it just have it list of the current 
> changes to the zlib code.
> -Alan.

More information about the core-libs-dev mailing list