import java.io.*;
class CopyMp3
{
public static void main(String[] args) throws IOException
{
long start =System.currentTimeMillis();
copyMp3();
long end=System.currentTimeMillis();
System.out.println((end-start)+":毫秒");
}
public static void copyMp3()throws IOException
{
FileInputStream fis=new FileInputStream("22.mp3");
FileOutputStream fos=new FileOutputStream("copymp3.mp3");
BufferedInputStream bufis=new BufferedInputStream(fis);
BufferedOutputStream bufos =new BufferedOutputStream(fos);
int len=0;
while ((len=bufis.read())!=-1)
{
bufos.write(len);
}
bufis.close();
bufos.close();
}
}
|