P
Peter
Hi
I use the following code to encrypt a file. How can i determine the size
of the file after encrypt? Because i want to set up a progress bar.
FileInputStream in = new FileInputStream(new
File("file.txt"));
FileOutputStream fileOut = new
FileOutputStream("newfile.txt");
CipherOutputStream out = new CipherOutputStream(fileOut,
encryptCipher);
byte[] buffer = new byte[1024];
int length;
while ( (length = in.read(buffer)) != -1) {
out.write(buffer, 0, length);
}
thanks
from Peter ([email protected])
I use the following code to encrypt a file. How can i determine the size
of the file after encrypt? Because i want to set up a progress bar.
FileInputStream in = new FileInputStream(new
File("file.txt"));
FileOutputStream fileOut = new
FileOutputStream("newfile.txt");
CipherOutputStream out = new CipherOutputStream(fileOut,
encryptCipher);
byte[] buffer = new byte[1024];
int length;
while ( (length = in.read(buffer)) != -1) {
out.write(buffer, 0, length);
}
thanks
from Peter ([email protected])