// java 中文件的复制
=======================================
import java.io.FileInputstream;
import java.io.FileOutputsteam;
import java.io.IOException;
public class Test{
public static void main(String[] args) throws IOException{
FileInputstream fis = new FileInputstream("1.txt");
FileOutputstream fos = new FileOutputstream("2.txt");
byte[] bbuf = new byte[1024];
int len = 0;
while((len=fis.reand (bbuf))! =-1){
fos.write(bbuf, 0, len);
}
fos.close;
fis.close;
}
}
|