本帖最后由 胡刚涛 于 2012-8-10 19:47 编辑
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
public class x {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
File inlog = new File("D:/Water lilies.jpg");
File charFile = new File("D:/Water lilies backup.jpg");
if(charFile.exists()) charFile.delete();
charFile.createNewFile();
FileInputStream fr = new FileInputStream(inlog);
FileOutputStream fw = new FileOutputStream(charFile);
BufferedReader br = new BufferedReader(new InputStreamReader(fr) );
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fw));
int bbb = fr.read();
while(bbb != -1){
fw.write(bbb);
bbb = fr.read();
}
fw.flush();
}
}
复制完的照片打开不一样求助!!!
|
|