通过ArrayList获得枚举类型- ArrayList<InputStream> al = new ArrayList<InputStream>();
- for(int i =1;i<5;i++)
- {
- al.add(new FileInputStream(i+".part"));
- }
- final Iterator<InputStream> it = al.iterator();
- Enumeration<InputStream> en= new Enumeration<InputStream>(){
- public boolean hasMoreElements() {
- return it.hasNext();
- }
- public InputStream nextElement() {
- return it.next();
- }
- };
复制代码
|
|