Package dk.netarkivet.common.utils.batch
Class ByteClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- dk.netarkivet.common.utils.batch.ByteClassLoader
-
public class ByteClassLoader extends ClassLoader
A subclass of ClassLoader that can take a byte[] containing a class file.
-
-
Constructor Summary
Constructors Constructor Description ByteClassLoader(byte[] bytes)
Constructor taking a class as an array of bytes.ByteClassLoader(File binaryFile)
Constructor that reads data from a file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class
defineClass()
Define the class that this class loader knows about.-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Constructor Detail
-
ByteClassLoader
public ByteClassLoader(File binaryFile)
Constructor that reads data from a file.- Parameters:
binaryFile
- A file containing a Java class.
-
ByteClassLoader
public ByteClassLoader(byte[] bytes)
Constructor taking a class as an array of bytes.- Parameters:
bytes
- Array of bytes containing a class definition.
-
-
Method Detail
-
defineClass
public Class defineClass()
Define the class that this class loader knows about. The name of the class is taken from the data given in the constructor.Note that this does *not* override any of the java.lang.ClassLoader#defineClass methods. Calling this method directly is the only way to get the class defined by this classloader.
- Returns:
- A new Class object for this class.
-
-