if (jar == null)
throw new ClassNotFoundException();
try {
// find the entry in the Jar file
JarEntry entry = jar.getJarEntry(className);
InputStream stream = jar.getInputStream(entry);
// read it into a class
int len = (int) entry.getSize();
int offset = 0;
int success = 0;
byte[] contents = new byte[len];
while (success < len) {
len -= success;
offset += success;
success = stream.read(contents, offset, len);
if (success == -1)
throw new ClassNotFoundException();
}
stream.read(contents, 0, (int) entry.getSize());
// actually define the class
result = defineClass(origName, contents, 0, contents.length);
if (resolveIt)