Code example for ObjectOutputStream

Methods: putFieldswriteFields

0
                                    new SimpleClass(1965, "Hello Jupiter")); 
        shortValue = getField.get("shortValue", (short) 4321);
    } 
     
    private void writeObject(ObjectOutputStream oos) throws IOException {
        putField = oos.putFields();
        // Do not put anything into putField so that the get methods 
        // will have to use default values. 
        oos.writeFields();
    } 
     
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE