out.writeInt(l.size()); Iterator iter = l.iterator(); while (iter.hasNext())
if (l == null)
   private void writeList(List l, ObjectOutput out) throws IOException   {      out.writeInt(l.size());      Iterator iter = l.iterator();      while (iter.hasNext())      {         out.writeObject(iter.next());      }   }