code: protected final void serialize(ObjectOutputStream oos, Collection collection) throws IOException
  	{
  		Object array[] = collection.toArray();
  		int serCount = 0;
  		for (int i = 0; i < array.length; i++)
  		{
  			if (array[i] instanceof Serializable)
  			{
  				serCount++;
  			}
  		}
  
  		oos.writeInt(serCount);
  		for (int i = 0; i < array.length; i++)
  		{
  			if (array[i] instanceof Serializable)
  			{
  				oos.writeObject(array[i]);
  			}
  		}
  	}
docs: Serializes the given collection.
  <p>
  First writes a <code>int</code> indicating the number of all serializable elements (implements <code>Serializable</code>, then objects are writtern one
  by one.
  </p>
  
  @param oos
  the stream where the collection is writtern to
  @param collection
  the collection to serialize
  @throws IOException
  if I/O exception occurs