update CAB to use Baskets
authorcrawshaw <crawshaw@ibex.org>
Thu, 6 Jan 2005 16:05:58 +0000 (16:05 +0000)
committercrawshaw <crawshaw@ibex.org>
Thu, 6 Jan 2005 16:05:58 +0000 (16:05 +0000)
darcs-hash:20050106160558-2eb37-5e87517e7859326056fa7dd7111c70d7e803836d.gz

src/org/ibex/util/CAB.java

index 71921c9..c8baaf0 100644 (file)
@@ -8,7 +8,8 @@ import java.io.*;
 import java.util.*;
 import java.util.zip.*;
 
-/** Reads a CAB file structure */
+/** Reads a CAB file structure.
+ *  @author FIXME */
 public class CAB {
 
     /** reads a CAB file, parses it, and returns an InputStream representing the named file */
@@ -45,7 +46,7 @@ public class CAB {
         for(int i=0; i<h.folders.length; i++) {
             InputStream is2 = new CFFOLDERInputStream(h.folders[i], dis);
             for(int j=0; j<h.folders[i].files.size(); j++) {
-                CFFILE file = (CFFILE)h.folders[i].files.elementAt(j);
+                CFFILE file = (CFFILE)h.folders[i].files.get(j);
                 if (file.fileName.equals(fileName)) return new LimitStream(is2, file.fileSize);
                 byte[] b = new byte[file.fileSize];
             }
@@ -244,7 +245,7 @@ public class CAB {
         int      compressionType = 0;           // compression type for this folder
         byte[]   reservedArea = null;           // per-folder reserved area
         int      indexInCFHEADER = 0;           // our index in CFHEADER.folders
-        Vector   files = new Vector();
+        Basket.List files = new Basket.Array();
 
         private CFHEADER header = null;
 
@@ -354,7 +355,7 @@ public class CAB {
             indexInCFHEADER = header.readCFFILEs++;
             header.files[indexInCFHEADER] = this;
             folder = header.folders[folderIndex];
-            folder.files.addElement(this);
+            folder.files.add(this);
         }
     }