ddth-cache-adapter-core/src/main/java/com/github/ddth/cacheadapter/utils/compressor/JdkDeflateCompressor.java
@Override
    public byte[] compress(byte[] data) throws IOException {
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
            Deflater def = new Deflater(compressionLevel, false);
            try (DeflaterOutputStream dos = new DeflaterOutputStream(baos, def)) {
                dos.write(data);
                dos.finish();
                return baos.toByteArray();
            }
        }
    }
@Override
    public byte[] compress(byte[] data) throws IOException {
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
            Deflater def = new Deflater(compressionLevel, false);
            try (DeflaterOutputStream dos = new DeflaterOutputStream(baos, def)) {
                dos.write(data);
                dos.finish();
                return baos.toByteArray();
            }
        }
    }
{@inheritDoc}

@throws IOException