public void scanClass(InputStream bits) throws IOException {
  DataInputStream dstream=new DataInputStream(new BufferedInputStream(bits));
  ClassFile cf=null;
  try {
    cf=new ClassFile(dstream);
    classIndex.put(cf.getName(),new HashSet<String>());
    scanClass(cf);
    if (scanMethodAnnotations || scanParameterAnnotations) {
      scanMethods(cf);
    }
    if (scanFieldAnnotations) {
      scanFields(cf);
    }
    if (cf.getInterfaces() != null) {
      Set<String> intfs=new HashSet<String>();
      for (      String intf : cf.getInterfaces()) {
        intfs.add(intf);
      }
      implementsIndex.put(cf.getName(),intfs);
    }
  }
  finally {
    dstream.close();
    bits.close();
  }
}

public void scanClass ( InputStream bits ) throws IOException { DataInputStream dstream = new DataInputStream ( new BufferedInputStream ( bits ) ) ; ClassFile cf = null ; try { cf = new ClassFile ( dstream ) ; classIndex . put ( cf . getName ( ) , new HashSet < String > ( ) ) ; scanClass ( cf ) ; if ( scanMethodAnnotations || scanParameterAnnotations ) { scanMethods ( cf ) ; } if ( scanFieldAnnotations ) { scanFields ( cf ) ; } if ( cf . getInterfaces ( ) != null ) { Set < String > intfs = new HashSet < String > ( ) ; for ( String intf : cf . getInterfaces ( ) ) { intfs . add ( intf ) ; } implementsIndex . put ( cf . getName ( ) , intfs ) ; } } finally { dstream . close ( ) ; bits . close ( ) ; } }
parse a . class file for annotations
