Inflater nowrap and padding byte requirement

Dawid Weiss dawid.weiss at
Fri Jan 12 10:08:48 UTC 2018


The javadoc for Inflater states that:

     * Note: When using the 'nowrap' option it is also necessary to provide
     * an extra "dummy" byte as input. This is required by the ZLIB native
     * library in order to support certain optimizations.

This doesn't seem to be a requirement anymore in newer zlib versions,
as clarified
by Mark Adler himself [1]. The changelog for zlib 1.2.0 indeed
mentions this "zero byte"
padding isn't required anymore [2]:

Changes in 1.2.0 (9 March 2003)
    - Raw inflate no longer needs an extra dummy byte at end

Perhaps it'd make sense to remove it from the JavaDoc, so that there's
 no need to complicate
downstream code?



More information about the core-libs-dev mailing list