本帖最后由 。。。。。。 于 2013-4-17 09:02 编辑
- <P> package com.itcast.day1820;</P>
- <P>import java.io.BufferedOutputStream;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.SequenceInputStream;</P>
- <P>public class SquenceStringTest {</P>
- <P> /**
- * @param args
- * @throws IOException
- */
- public static void main(String[] args) throws IOException {
-
- InputStream is1=new FileInputStream("D:\\1.mp3");
- InputStream is2=new FileInputStream("D:\\2.mp3");
- SequenceInputStream ss =new SequenceInputStream(is1,is2);
- BufferedOutputStream bufo=new BufferedOutputStream(new FileOutputStream("3.mp3"));
- byte[] b=new byte[1024];
- int s=0;
- while((s=ss.read(b))!=-1)
- {
- bufo.write(b,0,s);
- bufo.flush();
- }
- is1.close();
- is2.close();
- bufo.close();
- ss.close();
- }</P>
- <P>}
- </P>
复制代码 程序运行后,得出来的3.MP3有一百多M,还1和2加起来也就5M。这是怎么回事啊?
|