public class FileDemo {
public static void main(String[] args) {
try {
File f = new File("e:/e/123456.jpg");
FileInputStream ff = new FileInputStream(f);
BufferedInputStream bf = new BufferedInputStream(ff);
FileOutputStream fo = new FileOutputStream(f.getAbsolutePath());
BufferedOutputStream bo = new BufferedOutputStream(fo);
byte[]b=new byte[1024];
int len=0;
while((len=bf.read(b))!=-1) {
bo.write(b);
bo.flush();
}
bo.close();
fo.close();
bf.close();
ff.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}