This method of the SecurityClassLoader Class converts an array of bytes into an instance of Class and associates the new class with a set of permissions and a principal.
protected final synchronized Class defineClass(String name,byte data[],int offset,int length, PermissionSet permissions,Principal principal);
Returns the Class object that was created from the data.
name | The expected name of the class, using "." (not "/") as a separator, and without a trailing .class suffix. This value will be null if the name is unknown. |
data | The bytes that make up the class. |
offset | The start offset of the class data. |
length | The length of the class data. |
permissions | The permissions to associate with the new class. The value can be null, in which case the new class will have no associated permissions. |
principal | The principal to associate with the new class. The value can be null, in which case the new class will have no associated principal. |
This method is similar to the java.lang.Class.defineClass method with the added ability to associate a set of permissions with a class. As with the java.lang.Class.defineClass method, the class must be resolved before it can be used.
ClassFormatError if the data does not contain a valid Class.