Java.Lang.ClassLoader.DefineClass Method
Defines a new class with the specified name, byte code from the byte buffer and the optional protection domain.

Syntax

[Android.Runtime.Register("defineClass", "(Ljava/lang/String;Ljava/nio/ByteBuffer;Ljava/security/ProtectionDomain;)Ljava/lang/Class;", "")]
protected Class DefineClass (string name, Java.Nio.ByteBuffer b, Java.Security.ProtectionDomain protectionDomain)

Parameters

name
the expected name of the new class, may be null if not known.
b
the byte buffer containing the byte code of the new class.
protectionDomain
the protection domain to assign to the loaded class, may be null.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Lang.ClassFormatErrorif b does not contain a valid class.
Java.Lang.NoClassDefFoundErrorif className is not equal to the name of the class contained in b.

Remarks

Defines a new class with the specified name, byte code from the byte buffer and the optional protection domain. If the provided protection domain is null then a default protection domain is assigned to the class.

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1