Code example for ObjectInputStream

Methods: readFields

0
                shortValue == other.shortValue
                ); 
    } 
     
    private void readObject(ObjectInputStream ois) throws Exception {
        getField = ois.readFields();
        booleanValue = getField.get("booleanValue", true);
        byteValue = getField.get("byteValue", (byte) 0x0b);
        charValue = getField.get("charValue", (char) 'D');
        doubleValue = getField.get("doubleValue", 523452.4532);
        floatValue = getField.get("floatValue", 298.54f);
        longValue = getField.get("longValue", (long) 1234567890l);
        intValue = getField.get("intValue", 999999);
        objectValue = (Support_GetPutFieldsDefaulted.SimpleClass) 
                       getField.get("objectValue", 
                                    new SimpleClass(1965, "Hello Jupiter")); 
        shortValue = getField.get("shortValue", (short) 4321);
    } 
     
    private void writeObject(ObjectOutputStream oos) throws IOException {
        putField = oos.putFields();