It's hard to say what exactly is going on since we don't know what "getClassImplFromDataBase" does (is it taken from
here?).
A class must be a byte[] by the time ClassLoader gets hold of it, since that is the only way it will accept classes. What happens before that is entirely up to the classloader in use. The most common way would indeed be to read the contents of a file, either a single class in the shape of a .class file, or a collection of classes in a .jar file. The JRE comes with classloader that know how to do this, either from a file system, or via HTTP (for
applets). But you can write classloaders that read the data out of a DB -which is apparently what that method does, going by its name-, or the class can be created in memory by libraries such as
javassist.
What exactly must be in the byte[] when it gets to ClassLoader is defined in the
JVM spec. Its file extension really doesn't matter, as long as the classloader knows how to handle it.