6.3.2.2文件合并 文件合并流程: 1、找到要合并的文件并按文件合并的先后进行排序。 2、创建合并文件 3、依次从合并的文件中读取数据向合并文件写入数

[mw_shl_code=applescript,true]//测试文件合并方法 @Test public void testMerge() throws IOException { 
    //块文件目录   
  File chunkFolder = new File("F:/develop/ffmpeg/chunk/"); 
    //合并文件  
   File mergeFile = new File("F:/develop/ffmpeg/lucene1.mp4");
[/mw_shl_code]
[mw_shl_code=applescript,true]if(mergeFile.exists()){        
mergeFile.delete();  
   }    
//创建新的合并文件 
    mergeFile.createNewFile();   
  //用于写文件    
RandomAccessFile raf_write = new RandomAccessFile(mergeFile, "rw");   
  //指针指向文件顶端  
   raf_write.seek(0);   
  //缓冲区   
  byte[] b = new byte[1024];  
   //分块列表  
   File[] fileArray = chunkFolder.listFiles();   
  // 转成集合,便于排序   
  List<File> fileList = new ArrayList<File>(Arrays.asList(fileArray));  
   // 从小到大排序 
    Collections.sort(fileList, new Comparator<File>() {    
     @Override       
  public int compare(File o1, File o2) {     
        if (Integer.parseInt(o1.getName()) < Integer.parseInt(o2.getName())) {    
             return ‐1;    
         }          
   return 1;    
     }   
  });   
  //合并文件   
  for(File chunkFile:fileList){   
      RandomAccessFile raf_read = new RandomAccessFile(chunkFile,"rw");  
       int len = ‐1;   
      while((len=raf_read.read(b))!=‐1){    
         raf_write.write(b,0,len);    
       }      
   raf_read.close();   
  } 
    raf_write.close();  
}
[/mw_shl_code]
6.3.3 前端页面 
上传文件的页面内容参考:“资料”--》upload.vue文件 6.3.3.1 WebUploader介绍 
如何在web页面实现断点续传?
常见的方案有:
1、通过Flash上传,比如SWFupload、Uploadify。
2、安装浏览器插件,变相的pc客户端,用的比较少。 3、Html5
随着html5的流行,本项目采用Html5完成文件分块上传。  
本项目使用WebUploader完成大文件上传功能的开发,WebUploader官网地址: http://fexteam.gz01.bdysite.com/webuploader/