Code example for ObjectInput

Methods: readInt, readLong, readUTF

0
	} 
 
	@SuppressWarnings("unchecked") 
	@Override 
	final public void readExternal(ObjectInput obj_in) throws IOException, ClassNotFoundException{
		long sid=obj_in.readLong();
		if (serialVersionUID!=sid) {
			throw new IOException("serialVersionUID was not matched by saved UID");
		} 
 
//		Init 		 
		isSelected=false;
		task_active=false;
		profile_group_selected=false;
		filter_selected=true;
		 
//		Common		 
		profile_group=obj_in.readUTF();
		profile_type=obj_in.readUTF();
		profile_name=obj_in.readUTF();
		profile_enable=obj_in.readUTF();
		profile_group_active=obj_in.readInt();
		profile_update_time=obj_in.readLong();
		 
//		Task	 
		retrospective_enable=obj_in.readUTF();
		retrospective_number=obj_in.readUTF();
		profile_error_notification=obj_in.readUTF();
		 
//		action_action=SerializeUtil.readListString(obj_in); 
		action_action=(ArrayList<String>) SerializeUtilities.readListObject(obj_in);
		 
//		action_trigger=SerializeUtil.readListString(obj_in); 
		action_trigger=(ArrayList<String>) SerializeUtilities.readListObject(obj_in);
 
//		String t_action_action=obj_in.readUTF(); 
//		action_action=stringToStringList(t_action_action); 
//		String t_action_trigger=obj_in.readUTF(); 
//		action_trigger=stringToStringList(t_action_trigger); 
 
//		Timer	 
		time_date_time_type=obj_in.readUTF();
		time_day_of_the_week=obj_in.readUTF();
		time_date=obj_in.readUTF();
		time_time=obj_in.readUTF();
 
//		Action	 
		action_action_type=obj_in.readUTF();
		//ActionType=Android 
		action_activity_name=obj_in.readUTF();
		action_activity_package=obj_in.readUTF();
		action_activity_data_type=obj_in.readUTF();
		action_activity_uri_data=obj_in.readUTF();
		 
//		action_activity_extra_data_list=(ArrayList<ActivityExtraDataItem>) obj_in.readObject(); 
//		action_activity_extra_data_list=SerializeUtil.readListActivityExtraDataItem(obj_in); 
		action_activity_extra_data_list=(ArrayList<ActivityExtraDataItem>) SerializeUtilities.readListObject(obj_in);
		 
//ActionType=Music 
		action_sound_file_name=obj_in.readUTF();
		action_sound_vol_left=obj_in.readUTF();
		action_sound_vol_right=obj_in.readUTF();
//ActionType=Ringtone 
		action_ringtone_type=obj_in.readUTF();
		action_ringtone_name=obj_in.readUTF();
		action_ringtone_path=obj_in.readUTF();
		action_ringtone_vol_left=obj_in.readUTF();
		action_ringtone_vol_right=obj_in.readUTF();
//Compare 
		action_compare_target=obj_in.readUTF();
		action_compare_type=obj_in.readUTF();
		action_compare_result_action=obj_in.readUTF();
 
//		action_compare_val=(String[]) obj_in.readObject(); 
		action_compare_val=SerializeUtilities.readArrayString(obj_in);
		 
//		String t_compare_val=obj_in.readUTF(); 
//		compare_val=stringToStringArray(t_compare_val); 
		//Message 
		action_message_type=obj_in.readUTF();
		action_message_text=obj_in.readUTF(); 
		action_message_use_vibration=obj_in.readInt();
		action_message_use_led=obj_in.readInt();
		action_message_led_color=obj_in.readUTF();
		//Action Time  
		action_time_type=obj_in.readUTF();
		action_time_target=obj_in.readUTF(); 
		//Action Task  
		action_task_type=obj_in.readUTF();
		action_task_target=obj_in.readUTF(); 
		//Action Wait 
		action_wait_target=obj_in.readUTF();
		action_wait_timeout_value=obj_in.readUTF();
		action_wait_timeout_units=obj_in.readUTF(); 
		//Action Bean Shell Script 
		action_bsh_script=obj_in.readUTF();
	} 
 
	@Override 
	final public void writeExternal(ObjectOutput obj_out) throws IOException {
		obj_out.writeLong(serialVersionUID);