最近有点飘,觉得自己会了连源码都干直接删除了,结果再试的时候找不到问题,想看源码都不行
package dhcc.test;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test1 {
public static void main(String[] args) throws IOException {
String filePath = "D:\\POI\\01persCycleAuthPact.txt";
String filename = "D:\\POI\\test.txt";
FileInputStream fis = new FileInputStream(filePath);
FileOutputStream fos = new FileOutputStream(filename);
long l1 = System.currentTimeMillis();
byte[] bytes = new byte[1024];
int id = fis.read(bytes);
while (id != -1) {
System.out.println("复制中!!!!!!!!!!");
fos.write(bytes, 0, id);
id = fis.read(bytes);
}
long l2 = System.currentTimeMillis();
System.out.println(l2 - l1);
fis.close();
fos.close();
}
}