public int decryptFile(String file, String destFile, String decryptType) {
        int result = 0;
        try {
            Cipher cipher = getPattern(decryptType, DECRYPT_MODE);
            InputStream is = new FileInputStream(file);
            OutputStream out = new FileOutputStream(destFile);
            CipherOutputStream cos = new CipherOutputStream(out, cipher);
            byte[] buffer = new byte[1024];
            int r;
            while ((r = is.read(buffer)) >= 0) {
                cos.write(buffer, 0, r);
            }
            cos.close();
            out.close();
            is.close();
            result = 1;
        }catch (FileNotFoundException e) {
            result = 5;
        }  catch (Exception e) {
            throw new RuntimeException(e);
        }
        return result;
    }
The file file is decrypted and saved in the target file destFile.
@param file The file to be decrypted such as c:/test/file.txt
@param destFile The name of the file stored after decryption, such as c:/ decrypted file .txt
@param decryptType Decryption mode (ECB/CBC/OFB/CFB)
@return Decryption result 0: decryption abnormal; 1: decryption normal; 5: file to be decrypted not found
@author sucb
@date March 2, 2017 7:58:56 pm
chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/util/DesUtil.java