Inflater nowrap and padding byte requirement

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Inflater nowrap and padding byte requirement

Dawid Weiss

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?