ObjectOutputStream.AnnotateClass(Class) Method

Definition

Subclasses may implement this method to allow class data to be stored in the stream.

[Android.Runtime.Register("annotateClass", "(Ljava/lang/Class;)V", "GetAnnotateClass_Ljava_lang_Class_Handler")]
protected virtual void AnnotateClass (Java.Lang.Class? cl);
[<Android.Runtime.Register("annotateClass", "(Ljava/lang/Class;)V", "GetAnnotateClass_Ljava_lang_Class_Handler")>]
abstract member AnnotateClass : Java.Lang.Class -> unit
override this.AnnotateClass : Java.Lang.Class -> unit

Parameters

cl
Class

the class to annotate custom data for

Attributes

Remarks

Subclasses may implement this method to allow class data to be stored in the stream. By default this method does nothing. The corresponding method in ObjectInputStream is resolveClass. This method is called exactly once for each unique class in the stream. The class name and signature will have already been written to the stream. This method may make free use of the ObjectOutputStream to save any representation of the class it deems suitable (for example, the bytes of the class file). The resolveClass method in the corresponding subclass of ObjectInputStream must read and use any data or objects written by annotateClass.

Java documentation for java.io.ObjectOutputStream.annotateClass(java.lang.Class<?>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to