请教如何实现复制?谢谢
import * ;public class TestFileOutputStream {
public static void main (String args[]){
int b = 0;
FileInputStream in = null ;
FileOutputStream out = null ;
try {
in = new FileInputStream ("e:/java/code8");
out = new FileOutputStream ("e:/java/code8");
while ((b=in.read()) != -1){
out.write(b);
}
in.close();
out.close();
} catch (FileNotFoundException e2) {
System.out.println ("not found the file");
System.exit(-1);
} catch (IOException e1) {
System.out.println ("file copy error");
System.exit(-1);
}
System.out.println("file already copy");
}
}
请教如何实现复制?谢谢