protected void writeIterator(Output out,Iterator<Object> it){
  LinkedList<Object> list=new LinkedList<Object>();
  while (it.hasNext()) {
    list.addLast(it.next());
  }
  out.writeArray(list,this);
}

protected void writeIterator ( Output out , Iterator < Object > it ) { LinkedList < Object > list = new LinkedList < Object > ( ) ; while ( it . hasNext ( ) ) { list . addLast ( it . next ( ) ) ; } out . writeArray ( list , this ) ; }
writes an iterator out to the output
