public static int unwrap(final CharListIterator i, final char array[]) {
        int j = array.length, offset = 0;
        while (j-- != 0 && i.hasNext())
            array[offset++] = i.nextChar();
        return array.length - j - 1;
    }
public static int unwrap ( final CharListIterator i , final char array [ ] ) { int j = array . length , offset = 0 ; while ( j -- != 0 && i . hasNext ( ) ) array [ offset ++ ] = i . nextChar ( ) ; return array . length - j - 1 ; }
Unwraps an iterator into an array starting at a given offset for a given number of elements.
<br>This method iterates over the given type-specific iterator and stores the elements returned, up to a maximum of <code>length</code>, in the given array starting at <code>offset</code>. The
number of actually unwrapped elements is returned (it may be less than <code>max</code> if the iterator emits less than <code>max</code> elements).

@param i     a type-specific iterator.
@param array an array to contain the output of the iterator.
@return the number of elements unwrapped.