//文件的拷贝
public class Copy {
public static void copy(String inputPath, String outputPath) throws IOException {
long start = System.currentTimeMillis();
BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(new File(inputPath)));
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(outputPath)));
int length = -1;
byte[] buf = new byte[1024 * 16];
while ((length = bufferedInputStream.read(buf)) != -1) {
bufferedOutputStream.write(buf,0,length);
}
bufferedOutputStream.close();
bufferedInputStream.close();
long end = System.currentTimeMillis();
System.out.println("复制使用的时间为:"+(end - start));
}
}