out.write(buffer、0、rumRead)の行で、ファイルに書き込む代わりに、定義されたリストにそれを追加するにはどうすればよいですか?オブジェクトリストに追加しようとしましたが、うまくいきません。これが私の復号化方法です:
public static void decrypt(String file) {
try {
File output = new File(file.replace(encryptedFileType, initialFileType));
if (!(output.exists())) {
output.createNewFile();
}
InputStream in = new FileInputStream(file.replace(initialFileType, encryptedFileType));
OutputStream out = new FileOutputStream(output);
in = new CipherInputStream(in, dcipher);
int numRead = 0;
while ((numRead = in.read(buffer)) >= 0) {
out.write(buffer, 0, numRead);
}
out.close();
new File(file.replace(initialFileType, encryptedFileType)).delete();
} catch (IOException e) {
e.printStackTrace();
}
}