
- Java.io - Home
- Java.io - BufferedInputStream
- Java.io - BufferedOutputStream
- Java.io - BufferedReader
- Java.io - BufferedWriter
- Java.io - ByteArrayInputStream
- Java.io - ByteArrayOutputStream
- Java.io - CharArrayReader
- Java.io - CharArrayWriter
- Java.io - Console
- Java.io - DataInputStream
- Java.io - DataOutputStream
- Java.io - File
- Java.io - FileDescriptor
- Java.io - FileInputStream
- Java.io - FileOutputStream
- Java.io - FilePermission
- Java.io - FileReader
- Java.io - FileWriter
- Java.io - FilterInputStream
- Java.io - FilterOutputStream
- Java.io - FilterReader
- Java.io - FilterWriter
- Java.io - InputStream
- Java.io - InputStreamReader
- Java.io - LineNumberInputStream
- Java.io - LineNumberReader
- Java.io - ObjectInputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectOutputStream
- io - ObjectOutputStream.PutField
- Java.io - ObjectStreamClass
- Java.io - ObjectStreamField
- Java.io - OutputStream
- Java.io - OutputStreamWriter
- Java.io - PipedInputStream
- Java.io - PipedOutputStream
- Java.io - PipedReader
- Java.io - PipedWriter
- Java.io - PrintStream
- Java.io - PrintWriter
- Java.io - PushbackInputStream
- Java.io - PushbackReader
- Java.io - RandomAccessFile
- Java.io - Reader
- Java.io - SequenceInputStream
- Java.io - SerializablePermission
- Java.io - StreamTokenizer
- Java.io - StringBufferInputStream
- Java.io - StringReader
- Java.io - StringWriter
- Java.io - Writer
- Java.io package Useful Resources
- Java.io - Discussion
Java.io.ObjectStreamField Class
Introduction
The Java.io.ObjectStreamField class is a description of a Serializable field from a Serializable class. An array of ObjectStreamFields is used to declare the Serializable fields of a class.
Class declaration
Following is the declaration for Java.io.ObjectStreamField class −
public class ObjectStreamField extends Object implements Comparable<Object>
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 |
ObjectStreamField(String name, Class<?> type) This creates a Serializable field with the specified type. |
2 |
ObjectStreamField(String name, Class<?> type, boolean unshared) This creates an ObjectStreamField representing a serializable field with the given name and type. |
Class methods
Sr.No. | Method & Description |
---|---|
1 |
int compareTo(Object obj)
This method compares this field with another ObjectStreamField. |
2 |
String getName()
This method gets the name of this field. |
3 |
int getOffset()
This method returns the offset of field within instance data. |
4 |
Class<?> getType()
This method gets the type of the field. |
5 |
char getTypeCode()
This method returns character encoding of field type. |
6 |
String getTypeString()
This method returns the JVM type signature. |
7 |
boolean isPrimitive()
This method returns true if this field has a primitive type. |
8 |
boolean isUnshared()
This method returns boolean value indicating whether or not the serializable field represented by this ObjectStreamField instance is unshared. |
9 |
protected void setOffset(int offset)
This method returns offset within instance data. |
10 |
String toString()
This method returns a string that describes this field. |
Methods inherited
This class inherits methods from the following classes −
- Java.io.Object