- /** unpacks a Microsoft CAB file (possibly embedded in another file; we scan for 'MSCF' */
- public static class CAB extends Res {
- private Res parent;
- CAB(Res parent) { this.parent = parent; }
- private int swap_endian(int i) {
- return ((i & 0xff) << 24) | ((i & 0xff00) << 8) | ((i & 0xff0000) >>> 8) | (i >>> 24);
- }
- public InputStream getInputStream(String path) throws IOException {
- try {
- return org.xwt.util.CAB.getFileInputStream(parent.getInputStream(), 2, path);
- } catch (EOFException eof) {
- throw new JS.Exn("MSCF header tag not found in file");
- } catch (IOException ioe) {
- throw new JS.Exn("IOException while reading file");
- }
- }
- }
-