code: protected static void writeIterator(Output out, Iterator<Object> it) {
          log.trace("writeIterator");
          // Create LinkedList of collection we iterate thru and write it out later
          LinkedList<Object> list = new LinkedList<Object>();
          while (it.hasNext()) {
              list.addLast(it.next());
          }
          // Write out collection
          out.writeArray(list);
      }
docs: Writes an iterator out to the output
  
  @param out
  Output writer
  @param it
  Iterator to write