import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class IO {
public static void main(String[] args) throws IOException{
FileInputStream bufr = null;
try {
bufr = new FileInputStream("d:\\music\\曾经的你.mp3");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
FileOutputStream bufw=null;
bufw = new FileOutputStream("d:\\media\\c.mp3");//如果我把这换成System.out,为什么老报错啊
byte []buf=new byte[1024];
int len=0;
while((len=bufr.read(buf))!=-1){
bufw.write(buf,0,len);
}
bufw.close();
bufr.close();
}
}
|