public JarInfo loadJar() throws IOException {
  ZipInputStream zis=null;
  Manifest mf=null;
  boolean empty=true;
  try {
    zis=new ZipInputStream(jarStream);
    ZipEntry ent=null;
    while ((ent=zis.getNextEntry()) != null) {
      empty=false;
      String name=ent.getName();
      if (Manifest.isManifestName(name)) {
        ByteArrayOutputStream baos=new ByteArrayOutputStream();
        byte buffer[]=new byte[1024];
        for (; ; ) {
          int len=zis.read(buffer);
          if (len < 0) {
            break;
          }
          baos.write(buffer,0,len);
        }
        byte[] buf=baos.toByteArray();
        mf=new Manifest(buf);
      }
    }
  }
 catch (  IOException ex) {
    throw ex;
  }
catch (  Throwable th) {
    th.printStackTrace();
    throw new IOException("loadJar caught: " + th);
  }
 finally {
    if (zis != null) {
      try {
        zis.close();
      }
 catch (      Exception ex) {
      }
    }
  }
  if (empty) {
    throw new IOException("JAR file is corrupt or empty");
  }
  JarInfo ji=createJarInfo(mf);
  return ji;
}

public JarInfo loadJar ( ) throws IOException { ZipInputStream zis = null ; Manifest mf = null ; boolean empty = true ; try { zis = new ZipInputStream ( jarStream ) ; ZipEntry ent = null ; while ( ( ent = zis . getNextEntry ( ) ) != null ) { empty = false ; String name = ent . getName ( ) ; if ( Manifest . isManifestName ( name ) ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; byte buffer [ ] = new byte [ 1024 ] ; for ( ; ; ) { int len = zis . read ( buffer ) ; if ( len < 0 ) { break ; } baos . write ( buffer , 0 , len ) ; } byte [ ] buf = baos . toByteArray ( ) ; mf = new Manifest ( buf ) ; } } } catch ( IOException ex ) { throw ex ; } catch ( Throwable th ) { th . printStackTrace ( ) ; throw new IOException ( "loadJar caught: " + th ) ; } finally { if ( zis != null ) { try { zis . close ( ) ; } catch ( Exception ex ) { } } } if ( empty ) { throw new IOException ( "JAR file is corrupt or empty" ) ; } JarInfo ji = createJarInfo ( mf ) ; return ji ; }
load the classes , resources , etc .
