passing data from a file between methods
hi guys,
i have an encrypt method that reads in the data and encrypts it. withn the method. i need to change it so that there is a User input method and an encyrpt method. what i was wondering is how i stream the input file data from the user input method to the encrypt method.
the user enters the file to read.
// user inputs the file to encrypt
System.out.println("please select the file to encrypt");
BufferedReader fileInput =new BufferedReader(new InputStreamReader(System.in));
String encFileToRead =null;
encFileToRead = fileInput.readLine();
the file is used by file input stream
FileImageInputStream fileInputStream =new FileImageInputStream(new File(encFileToRead));
byte[] buffer =newbyte[1024];
int numberBytesRead = 0;
while ((numberBytesRead = fileInputStream.read(buffer)) != -1){
encryptedCipherOutputStream.write(buffer, 0, numberBytesRead);
}
encryptedCipherOutputStream.close();
thanks in advance

