Code example for ObjectInputStream

Methods: readFields

0
        o.writeFields();
    } 
 
    private void readObject(ObjectInputStream in) throws NotActiveException,
            IOException, ClassNotFoundException { 
        getField = in.readFields();
    } 
} 
 
 
// Primitive fields are necessary to cause the NullPointerException.  
class MockClass implements Serializable {
    String str1 = "string 1";
    String str2 = "string 2";
    int int1 = 1;
    int int2 = 2;
    String str3 = "string 3";
} 
 
 
// Overrides writeClassDescriptor to store ObjectStreamClass in map.