(2) to change the way we handle the returned result Z_BUF_ERROR. Now the
implementation expects that there might be bytes read from the input and
written to the output buffer when the deflateParams()/deflate() returns
Z_BUF_ERROR. It is "interpreted as there is no enough buffer space for
but the deflater has decoded input bytes and write out output bytes as
possible, come back with more available output space".
See related github/zlib discussions at #275  and #305