----------- android培训、java培训、java学习型技术博客、期待与您交流! ------------
/**
* 演示 map3复制 通过 缓冲区*
* @author lazy
*
*/
public class CopyMp3Demo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
copy_1();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// 通过字节流缓冲区复制
// 缓冲区里自带数组 所以不要定义数组了
public static void copy_1() throws IOException {
//读取1.mp3字节内容
BufferedInputStream bufis = new BufferedInputStream(
new FileInputStream("1.mp3"));
BufferedOutputStream bufos = new BufferedOutputStream(
new FileOutputStream("copy1.mp3"));
int len = 0;
while ((len = bufis.read()) != -1) {
bufos.write(len);
}
bufos.close();
bufis.close();
}
}
----------------------- android培训、java培训、java学习型技术博客、期待与您交流! ----------------------
详情请查看:http://edu.csdn.net/heima