protected void writeIterator(Iterator<?> iterator, CharBuf buffer) {
        if (!iterator.hasNext()) {
            buffer.addChars(EMPTY_LIST_CHARS);
            return;
        }
        buffer.addChar(OPEN_BRACKET);
        while (iterator.hasNext()) {
            Object it = iterator.next();
            if (!isExcludingValues(it)) {
                writeObject(it, buffer);
                buffer.addChar(COMMA);
            }
        }
        buffer.removeLastChar(COMMA); // dangling comma
        buffer.addChar(CLOSE_BRACKET);
    }
protected void writeIterator ( Iterator < ? > iterator , CharBuf buffer ) { if ( ! iterator . hasNext ( ) ) { buffer . addChars ( EMPTY_LIST_CHARS ) ; return ; } buffer . addChar ( OPEN_BRACKET ) ; while ( iterator . hasNext ( ) ) { Object it = iterator . next ( ) ; if ( ! isExcludingValues ( it ) ) { writeObject ( it , buffer ) ; buffer . addChar ( COMMA ) ; } } buffer . removeLastChar ( COMMA ) ; buffer . addChar ( CLOSE_BRACKET ) ; }
Serializes iterator and writes it into specified buffer.