本帖最后由 fei_xiong 于 2014-4-29 11:36 编辑
我想把张孝祥老师的交通灯管理视频合成一个,然后就写了个程序试试,结果大小151M对了,但是只能播放第一集的内容,求原因啊
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- public class HeBing {
- public static void main(String[] args) throws IOException {
- String fileName;
- FileInputStream fis = null;
- FileOutputStream fos = new FileOutputStream("d:\\交通灯.avi");
- byte[] b = new byte[1024];
- int len = 0 ;
- for (int x = 1; x <= 11; x++) {
- if (x <= 9 )
- fileName = "d:\\0" + x + ".avi";
- else
- fileName="d:\\" + x + ".avi";
-
- fis = new FileInputStream(fileName);
-
- while ((len = fis.read(b))!=-1) {
- fos.write(b,0,len);
- }
- System.out.println(fileName+"完成");
- }
-
- fis.close();
- fos.close();
- }
- }
复制代码 |
|