ObjectInputStream.GetField

Introduction

The Java.io.ObjectInputStream.GetField class provide access to the persistent fields read from the input stream.

Class declaration

Following is the declaration for Java.io.ObjectInputStream.GetField class −

public abstract static class ObjectInputStream.GetField
   extends Object

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

Class constructors

Sr.No.Constructor & Description
1ObjectInputStream.GetField()Single Constructor

Class methods

Sr.No.Method & Description
1abstract boolean defaulted(String name)This method return true if the named field is defaulted and has no value in this stream.
2abstract boolean get(String name, boolean val)This method gets the value of the named boolean field from the persistent field.
3abstract byte get(String name, byte val)This method gets the value of the named byte field from the persistent field.
4abstract char get(String name, char val)This method gets the value of the named char field from the persistent field.
5abstract double get(String name, double val)This method gets the value of the named double field from the persistent field.
6abstract float get(String name, float val)This method gets the value of the named float field from the persistent field.
7abstract int get(String name, int val)This method gets the value of the named int field from the persistent field.
8abstract long get(String name, long val)This method gets the value of the named long field from the persistent field.
9abstract Object get(String name, Object val)This method get the value of the named Object field from the persistent field.
10abstract short get(String name, short val)This method gets the value of the named short field from the persistent field.
11abstract ObjectStreamClass getObjectStreamClass()This method gets the ObjectStreamClass that describes the fields in the stream.

Methods inherited

This class inherits methods from the following classes −

  • Java.io.Object

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *