220
221 }
222
223 /**
224 * readObject is called to restore the state of the SerialRef from
225 * a stream.
226 */
227 private void readObject(ObjectInputStream s)
228 throws IOException, ClassNotFoundException {
229 ObjectInputStream.GetField fields = s.readFields();
230 object = fields.get("object", null);
231 baseTypeName = (String) fields.get("baseTypeName", null);
232 reference = (Ref) fields.get("reference", null);
233 }
234
235 /**
236 * writeObject is called to save the state of the SerialRef
237 * to a stream.
238 */
239 private void writeObject(ObjectOutputStream s)
240 throws IOException, ClassNotFoundException {
241
242 ObjectOutputStream.PutField fields = s.putFields();
243 fields.put("baseTypeName", baseTypeName);
244 fields.put("object", object);
245 // Note: this check to see if it is an instance of Serializable
246 // is for backwards compatibility
247 fields.put("reference", reference instanceof Serializable ? reference : null);
248 s.writeFields();
249 }
250
251 /**
252 * The identifier that assists in the serialization of this <code>SerialRef</code>
253 * object.
254 */
255 static final long serialVersionUID = -4727123500609662274L;
256
257
258 }
|
220
221 }
222
223 /**
224 * readObject is called to restore the state of the SerialRef from
225 * a stream.
226 */
227 private void readObject(ObjectInputStream s)
228 throws IOException, ClassNotFoundException {
229 ObjectInputStream.GetField fields = s.readFields();
230 object = fields.get("object", null);
231 baseTypeName = (String) fields.get("baseTypeName", null);
232 reference = (Ref) fields.get("reference", null);
233 }
234
235 /**
236 * writeObject is called to save the state of the SerialRef
237 * to a stream.
238 */
239 private void writeObject(ObjectOutputStream s)
240 throws IOException {
241
242 ObjectOutputStream.PutField fields = s.putFields();
243 fields.put("baseTypeName", baseTypeName);
244 fields.put("object", object);
245 // Note: this check to see if it is an instance of Serializable
246 // is for backwards compatibility
247 fields.put("reference", reference instanceof Serializable ? reference : null);
248 s.writeFields();
249 }
250
251 /**
252 * The identifier that assists in the serialization of this <code>SerialRef</code>
253 * object.
254 */
255 static final long serialVersionUID = -4727123500609662274L;
256
257
258 }
|