import java.io.BufferedInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.imageio.stream.FileImageInputStream;
import java.io.*;
public class CopyMp3 {
/**
* 复制一个MP3文件
* 1.通过字节流的缓冲区去完成
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
// TODO 自动生成的方法存根
copy_1();
}
public static void copy_1() throws IOException{
BufferedInputStream bufis = new BufferedInputStream(new FileInputStream("E:\\阿杜-离别.mp3"));
BufferedOutputStream bufos = new BufferedOutputStream(new FileOutputStream("E:\\阿杜-离别1.mp3"));
int by = 0;
while((by=bufis.read())!=-1){
bufos.write(by);
}
bufis.close();
bufos.close();
}
} |
|