import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test {public static void TestfileQuick(File filein, File fileout) throws IOException{
FileInputStream in = new FileInputStream(filein);
FileOutputStream out = new FileOutputStream(fileout);
byte[] buf=new byte[8*1024];
int b;
while((b=in.read( buf, 0, buf.length))!=-1){
out.write(buf, 0, b);
}
in.close();
out.close();
}
public static void main(String[] args){
try{
long start = System.currentTimeMillis();
Test.TestfileQuick(new File("C:\\Users\\Administrator\\Desktop\\尧十三 - 牧羊曲(Demo).mp3"),
new File("C:\\Users\\Administrator\\Desktop\\1.mp3"));
long end = System.currentTimeMillis();
System.out.println("时间:" + (end - start));
}catch(IOException e){
e.printStackTrace();
}
}
}
![](https://images2015.cnblogs.com/blog/905889/201604/905889-20160408201040859-502732553.png)