aes - Java使用对称加密算法加密大文件内存资源消耗问题
ringa_lee
ringa_lee 2017-04-18 10:40:05
0
1
740
ringa_lee
ringa_lee

ringa_lee

reply all(1)
阿神

Use CipherOutputStream

Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, key);

InputStream is = new FileInputStream(file);  
CipherOutputStream out = new CipherOutputStream(new FileOutputStream(dest), cipher)

IOUtils.copyLarge(is, out);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template