Java: How to load Class stored as byte[] into the JVM?
If one has serialized the entire .class file into byte[], and assuming the name of the class is known (passed along with the byte[]), how do you convert byte[] -> Class -> then load it to the JVM so that I could later use it by calling the Class.forName()? NOTE: I'm doing this because I sent the .class over to another host, and the host's JVM doesn't know about this .class. I'm actually using something like this right now in a test to give a set of Class definitions as byte[] to a ClassLoader: public static class ByteClassLoader extends URLClassLoader { private final Map<String, byte[]>