Share via


ObjectOutputStream.WriteClassDescriptor(ObjectStreamClass) Method

Definition

Write the specified class descriptor to the ObjectOutputStream.

[Android.Runtime.Register("writeClassDescriptor", "(Ljava/io/ObjectStreamClass;)V", "GetWriteClassDescriptor_Ljava_io_ObjectStreamClass_Handler")]
protected virtual void WriteClassDescriptor (Java.IO.ObjectStreamClass? desc);
[<Android.Runtime.Register("writeClassDescriptor", "(Ljava/io/ObjectStreamClass;)V", "GetWriteClassDescriptor_Ljava_io_ObjectStreamClass_Handler")>]
abstract member WriteClassDescriptor : Java.IO.ObjectStreamClass -> unit
override this.WriteClassDescriptor : Java.IO.ObjectStreamClass -> unit

Parameters

desc
ObjectStreamClass

class descriptor to write to the stream

Attributes

Exceptions

if an error occurs while writing to the target stream.

Remarks

Write the specified class descriptor to the ObjectOutputStream. Class descriptors are used to identify the classes of objects written to the stream. Subclasses of ObjectOutputStream may override this method to customize the way in which class descriptors are written to the serialization stream. The corresponding method in ObjectInputStream, readClassDescriptor, should then be overridden to reconstitute the class descriptor from its custom stream representation. By default, this method writes class descriptors according to the format defined in the Object Serialization specification.

Note that this method will only be called if the ObjectOutputStream is not using the old serialization stream format (set by calling ObjectOutputStream's useProtocolVersion method). If this serialization stream is using the old format (PROTOCOL_VERSION_1), the class descriptor will be written internally in a manner that cannot be overridden or customized.

Added in 1.3.

Java documentation for java.io.ObjectOutputStream.writeClassDescriptor(java.io.ObjectStreamClass).

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