Code example for GregorianCalendar

Methods: get, setTime

0
	   public void writeData(DataOutput out) throws IOException
	   { 
	      DataIO.writeFixedString(name, NAME_SIZE, out);
	      out.writeDouble(salary);
 
	      GregorianCalendar calendar = new GregorianCalendar();
	      calendar.setTime(hireDay);
	      out.writeInt(calendar.get(Calendar.YEAR));
	      out.writeInt(calendar.get(Calendar.MONTH) + 1);
	      out.writeInt(calendar.get(Calendar.DAY_OF_MONTH));
	   } 
 
	   /** 
	      Reads employee data from a data input 
	      @param in the data input 
	   */ 
	   public void readData(DataInput in) throws IOException
	   { 
	      name = DataIO.readFixedString(NAME_SIZE, in);
	      salary = in.readDouble();
	      int y = in.readInt();