Code example for ObjectOutputStream

Methods: putFields, writeFields

0
                getField.get("objectValue", (Object) null);
        shortValue = getField.get("shortValue", (short) 0);
    } 
     
    private void writeObject(ObjectOutputStream oos) throws IOException {
        putField = oos.putFields();
        putField.put("booleanValue", booleanValue);
        putField.put("byteValue", byteValue);
        putField.put("charValue", charValue);
        putField.put("doubleValue", doubleValue);
        putField.put("floatValue", floatValue);
        putField.put("longValue", longValue);
        putField.put("intValue", intValue);
        putField.put("objectValue", objectValue);
        putField.put("shortValue", shortValue);
        oos.writeFields();
    } 
}