// 合并文件
private static void merge() throws FileNotFoundException, IOException {
ArrayList<FileInputStream> al = new ArrayList<>();
for (int i = 1; i <= 4; i++) {
al.add(new FileInputStream("test" + i + ".part"));
}
final java.util.Iterator<FileInputStream> it = al.iterator();
// Enumeration是接口,要复实现其接口中的方法
Enumeration<FileInputStream> en = new Enumeration<FileInputStream>() {
@Override
public boolean hasMoreElements() {
// 是否还有下一个元素
return it.hasNext();
}