Guys I need help.
package com.codegym.task.task18.task1826;
/*
Encryption
*/
import java.io.*;
import java.util.Base64;
public class Solution {
public static void main(String[] args)throws IOException, FileNotFoundException {
// Create an input stream for the file passed as the second argument (fileName)
FileInputStream fileInputStream = new FileInputStream(args[1]);
//Create an output stream for the file passed as the third argument (fileOutputName)
FileOutputStream fileOutputStream = new FileOutputStream(args[2]);
// In "-e" mode, the program should encrypt fileName and write the result to fileOutputName
if(args[0].equals("-e")){
fileOutputStream.write(Base64.getEncoder().encode(args[1].getBytes()));
}
// In "-d" mode, the program should decrypt fileName and write the result to fileOutputName
else if(args[0].equals("-d")){
fileOutputStream.write(Base64.getDecoder().decode(args[1].getBytes()));
}
//The file streams must be closed
fileInputStream.close();
fileOutputStream.close();
}
}