byteValues[i] = virtualMachine.mirrorOf(clazz[i]);
}
array.setValues(Arrays.asList(byteValues));
// load the class with the class loader
final ObjectReference loadedClazz = (ObjectReference) invokeMethod(myClassLoader, _URLClassLoader, "defineClass", "([BII)Ljava/lang/Class;", new Value[] { array, virtualMachine.mirrorOf(0), virtualMachine.mirrorOf(clazz.length) });
final ClassType _clazz = (ClassType) ((ClassObjectReference) loadedClazz).reflectedType();
if (argsForInstantiate != null) {
// prepare the class
invokeMethod(myClassLoader, _URLClassLoader, "resolveClass", "(Ljava/lang/Class;)V", new Value[] { loadedClazz });
invokeMethod(loadedClazz, _Class, "getMethods", "()[Ljava/lang/reflect/Method;", new Value[0]);
// invoke its constructor
final ObjectReference loadedInstance = newInstance(_clazz, "()V", new Value[0]);
// invoke its go method
invokeMethod(loadedInstance, _clazz, "go", "(Ljava/lang/String;)V", new Value[] { virtualMachine.mirrorOf(argsForInstantiate) });
}