String resourcePath="";
String savePath="";
RandomAccessFile accessFile = new RandomAccessFile(file, "r")
byte[] buffer=new byte[1024*1024]
int index=0;
int cout=0;
while((count=accessFile.read(buffer))!=-1){
String chunkName= String.format("%sfile_%d",savePath,index++);
RandomAccessFile chunk=new RandomAccessFile(chunkName, "rw");
chunk.write(buffer,0,count);
}
accessFile.close;
分片结束,如果想合并,就是对分片内容进行排序,用流读取进行合并