@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();
            }
        }
    }
@ 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
{ @inheritDoc }