Code example for ObjectOutput

Methods: writeLong, writeObject

0
		return timeToLive;
	} 
 
	@Override 
	public void writeExternal(ObjectOutput out) throws IOException {
		out.writeLong(timeToLive);
		out.writeObject(value);
	} 
 
	@Override 
	public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
		this.timeToLive = in.readLong();
		this.value = in.readObject();
	} 
 
}