English 中文(简体)
Java.io package classes

Java.io package extras

Java.io package Useful Resources

Selected Reading

Java.io - ObjectStreamClass
  • 时间:2024-11-03

Java.io.ObjectStreamClass Class


Previous Page Next Page  

Introduction

The Java.io.ObjectStreamClass class is Seriapzation s descriptor for classes. It contains the name and serialVersionUID of the class. The ObjectStreamClass for a specific class loaded in this Java VM can be found/created using the lookup method.

Class declaration

Following is the declaration for Java.io.ObjectStreamClass class −

pubpc class ObjectStreamClass
   extends Object
      implements Seriapzable

Field

Following are the fields for Java.io.ObjectStreamClass class −

    static ObjectStreamField[] NO_FIELDS − This is the serialPersistentFields value indicating no seriapzable fields.

Class methods

Sr.No. Method & Description
1 Class<?> forClass()

This method returns the class in the local VM that this version is mapped to.

2 ObjectStreamField getField(String name)

This method gets the field of this class by name.

3 ObjectStreamField[] getFields()

This method returns an array of the fields of this seriapzable class.

4 String getName()

This method returns the name of the class described by this descriptor.

5 long getSerialVersionUID()

This method returns the serialVersionUID for this class.

6 static ObjectStreamClass lookup(Class<?> cl)

This method finds the descriptor for a class that can be seriapzed.

7 static ObjectStreamClass lookupAny(Class<?> cl)

This method returns the descriptor for any class, regardless of whether it implements Seriapzable.

8 String toString()

This method returns a string describing this ObjectStreamClass.

Methods inherited

This class inherits methods from the following classes −

    Java.io.Object

Advertisements