Slide 30
Slide 30 text
EncryptedFile
@NonNull
public FileOutputStream openFileOutput()
throws GeneralSecurityException, IOException {
if (mFile.exists()) {
throw new IOException("output file already exists, please use a new file: "
+ mFile.getName());
}
FileOutputStream fileOutputStream = new FileOutputStream(mFile);
OutputStream encryptingStream =
mStreamingAead.newEncryptingStream(
fileOutputStream,
mFile.getName().getBytes(UTF_8));
return new EncryptedFileOutputStream(fileOutputStream.getFD(), encryptingStream);
}
if (mFile.exists()) {
throw new IOException("output file already exists, please use a new file: "
+ mFile.getName());
} زੌ ੌ ݺਵ۽ Output ೡ ҃ Exception ߊࢤ