Hello all,
I am trying to load class files within a jar file. The program extracts and iterates through all the ZipEntrys. For each ZipEntry i obtain the InputStream and read in the contents of each class file in to a byte array. I've made a ClassLoader which relaxes the access rights to the define method which take an array of bytes: Class defineClass(
String name, byte[] data, int start, int end);
However only certain classes correctly return a Class objects. The majority of class files i try to read in this manner throws a ClassFormatException with one if the following messages:
Illegal constant pool type
Illegal UTF8 string in constant pool
Illegal constant pool index
Arguments can't fit into locals
any ideas?