Java image encryption resolve the issue
help it's urgent.
thanks in advance.
package binaryfilehandling;
import java.io.FileNotFoundException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/**
*
* @author WLAN_04
*/
public class Main {
/**
* #-Link-Snipped-# args the command line arguments
*/
public static void main(String[] args) {
String strSourceFile="C://hare//Sunset.jpg";
String strDestinationFile="C://hare//aaa.jpg";
String a;
int c;
try
{
//create FileInputStream object for source file
FileInputStream fin = new FileInputStream(strSourceFile);
//create FileOutputStream object for destination file
FileOutputStream fout = new FileOutputStream(strDestinationFile);
byte[] b = new byte[10];
byte[] b1 = new byte[10];
int noOfBytes = 0;
System.out.println("Copying file using streams");
//read bytes from source file and write to destination file
while( (noOfBytes = fin.read(b)) != -1 )
{
System.out.println(b.length);
int j=0;
for(int i=b.length-1;i>=0;i--){
b1[j]=b;
// System.out.println(b1);
//System.out.println(b);
j++;
}
fout.write(b1, 0 , noOfBytes);
}
System.out.println("File copied!");
//close the streams
fin.close();
fout.close();
}
catch(FileNotFoundException fnf)
{
System.out.println("Specified file not found :" + fnf);
}
catch(IOException ioe)
{
System.out.println("Error while copying file :" + ioe);
}
// TODO code application logic here
}
}