本帖最后由 还是回去火星吧 于 2014-3-3 00:08 编辑
- public static void seqIn()throws IOException{
- Vector<FileInputStream> v=new Vector<FileInputStream>();
- for(int x=1;x<4;x++){
- v.add(new FileInputStream("D:\\DD\\"+x+".mp3"));
- }
- Enumeration<FileInputStream> en=v.elements();
- SequenceInputStream sis=new SequenceInputStream(en);//合并
- FileWriter fw1=new FileWriter("D:\\DD\\a.mp3");//毕老师说可以用字符流,怎么用?求方法。
- FileOutputStream fw=new FileOutputStream("D:\\DD\\a.mp3");
- byte[] bf=new byte[1024];
- int len=0;
- while((len=sis.read(bf))!=-1){
- fw.write(bf,0,len);
- fw.flush();
- }
- sis.close();
- fw.close();
- }
复制代码
|