public static byte[] decompress(final byte[] bytes, final int expectedSize) throws ImagingException {
        try {
            final Inflater inflater = new Inflater();
            inflater.setInput(bytes);
            final byte[] result = Allocator.byteArray(expectedSize);
            inflater.inflate(result);
            return result;
        } catch (final DataFormatException e) {
            throw new ImagingException("Unable to decompress image", e);
        }
    }
Compress the byte[] using ZLIB deflate decompression.

@param bytes        The bytes to decompress
@param expectedSize The expected size of the decompressed byte[].
@return The decompressed bytes.
@throws ImagingException if the bytes could not be decompressed.
@see Inflater
src/main/java/org/apache/commons/imaging/common/ZlibDeflate.java