Code example for ObjectInputStream

Methods: availablereadObject

	private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		// we know that when deserializing this object there will be two objects in a row. 
		// the first object is the messageaddress, which will tell us if we need to de-serialize 
		// the second one.  
		this.adr = (MessageAddress) in.readObject();
		if(this.adr.isForThisRobot()) {
			this.msg = (RobotMessage) in.readObject();
		} else { 
			this.msg = null;