2003/09/29 01:41:51
[org.ibex.core.git] / src / org / xwt / Res.java
index 862b12d..01856f2 100644 (file)
@@ -173,7 +173,7 @@ public abstract class Res extends JS {
             return ((i & 0xff) << 24) | ((i & 0xff00) << 8) | ((i & 0xff0000) >>> 8) | (i >>> 24);
         }
         public InputStream getInputStream(String path) throws IOException {
-            InputStream is = parent.getInputStream();
+            /* InputStream is = parent.getInputStream();
             byte[] scan = new byte[4];
             int ofs = 0;
             for(int i=0; i<2; i++)  {
@@ -189,6 +189,14 @@ public abstract class Res extends JS {
             }
             Log.log(this, "found MSCF header at offset " + ofs);
             return org.xwt.util.CAB.getFileInputStream(is, path, true);
+            */
+            try {
+               return org.xwt.util.CAB.getFileInputStream(is, 2, path);
+            } catch (EOFException eof) {
+               throw new JS.Exn("MSCF header tag not found in file");
+            } catch (EOFException eof) {
+               throw new JS.Exn("IOException while reading file");
+            }
         }
     }