InflaterOutputStream has an internal buffer which is used for the inflated data. This buffer can be configured to a custom size (the default is 512 bytes) by using the specialized "InflaterOutputStream(OutputStream out, Inflater infl, int bufLen)" constructor. A bigger buffer, results in fewer native calls to "write()" on the associated OutputStream and better overall performance.
Unfortunately "InflaterOutputStream.write(byte b, int off, int len)" unnecessarily chunks its byte input buffer "b" into pieces of maximum 512 bytes before feeding them to the underlying Inflater. This unnecessarily increases the number of native calls to Inflater.inflate() and limits the benefit of the configurable internal buffer to a size of ~(512 * compression-ratio) bytes.
Instead, we could easily pass the complete input buffer "b" as input to the underlying Inflater. This simplifies the code and results in up to ~25% performance improvements for bigger internal buffers (see attached JMH benchmark).