public static byte[] compressForZlib(String stringToCompress) {
        byte[] returnValues = null;

        try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                returnValues = compressForZlib
                        (
                                stringToCompress.getBytes(StandardCharsets.UTF_8)
                        );
            } else {
                returnValues = compressForZlib
                        (
                                stringToCompress.getBytes("UTF-8")
                        );
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return returnValues;
    }
zlib compress 2 byte

@param stringToCompress
@return
arms/src/main/java/com/jess/arms/utils/ZipHelper.java