public static byte[] inflateToByteArray(final byte[] bytes) {
        val bais = new ByteArrayInputStream(bytes);
        var bytesRead = -1;
        val buf = new byte[BUFFER_LENGTH];

        try (val iis = new InflaterInputStream(bais); val baos = new ByteArrayOutputStream()) {
            while ((bytesRead = iis.read(buf)) != -1) {
                baos.write(buf, 0, bytesRead);
            }
            return baos.toByteArray();
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
            return null;
        }
    }
Decode byte array byte [].

@param bytes the bytes
@return the byte [ ]
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CompressionUtils.java