code: public void write(DataOutput out) throws IOException {
      // write a prefix indicating the type of UGI being written
      Text.writeString(out, UGI_TECHNOLOGY);
      // write this object
      Text.writeString(out, userName);
      WritableUtils.writeVInt(out, groupNames.length);
      for (String groupName : groupNames) {
        Text.writeString(out, groupName);
      }
    }
docs: Serialize this object
  First write a string marking that this is a UGI in the string format,
  then write this object's serialized form to the given data output
  
  @param out output stream
  @exception IOException if encounter any error during writing