This commit is contained in:
Looly
2021-10-21 13:18:53 +08:00
parent 04032f1094
commit 98512fa1f2
7 changed files with 68 additions and 14 deletions

View File

@@ -300,9 +300,11 @@ public class SymmetricCrypto implements SymmetricEncryptor, SymmetricDecryptor,
throw new CryptoException(e);
} finally {
lock.unlock();
// issue#I4EMST@Gitee
// CipherOutputStream必须关闭才能完全写出
IoUtil.close(cipherOutputStream);
if (isClose) {
IoUtil.close(data);
IoUtil.close(cipherOutputStream);
}
}
}
@@ -351,9 +353,11 @@ public class SymmetricCrypto implements SymmetricEncryptor, SymmetricDecryptor,
throw new CryptoException(e);
} finally {
lock.unlock();
// issue#I4EMST@Gitee
// CipherOutputStream必须关闭才能完全写出
IoUtil.close(cipherInputStream);
if (isClose) {
IoUtil.close(data);
IoUtil.close(cipherInputStream);
}
}
}