Exemplo n.º 1
0
 protected Class findClass(String className) throws ClassNotFoundException {
   try {
     ByteArrayOutputStream bos = new ByteArrayOutputStream();
     InstanceKlass klass = SystemDictionaryHelper.findInstanceKlass(className);
     ClassWriter cw = new ClassWriter(klass, bos);
     cw.write();
     byte[] buf = bos.toByteArray();
     return defineClass(className, buf, 0, buf.length);
   } catch (Exception e) {
     throw (ClassNotFoundException) new ClassNotFoundException().initCause(e);
   }
 }