问题见代码注释处
public static void copy_1() throws IOException{
BufferedOutputStream bufos = new BufferedOutputStream(new FileOutputStream("2.mp3"));
BufferedInputStream bufis = new BufferedInputStream(new FileInputStream("1.mp3"));
int byt = 0;
while((byt = bufis.read())!= -1){
bufos.write(byt);
//这里需要刷新一下吗
}
bufos.close();
bufis.close();
}
}
|
|