class IteratorReader extends Reader {
    private Iterator<String> iterator;
    private StringReader current;

    public IteratorReader(Iterable<String> iterable) {
        if (iterable == null) {
            throw new IllegalArgumentException("`iterable' is null");
        }
        Iterator<String> iter = iterable.iterator();
        if (iter == null) {
            throw new IllegalArgumentException("`iterable' did not produce iterator");
        }
        this.iterator = iter;
    }

    public IteratorReader(Iterator<String> iterator) {
        if (iterator == null) {
            throw new IllegalArgumentException("`iterator' is null");
        }
        this.iterator = iterator;
    }

    @Override
    public int read(char[] cbuf, int off, int len) throws IOException {<FILL_FUNCTION_BODY>}

    @Override
    public void close() {
        iterator = null;
        current = null;
    }
}

        if (current != null) {
            int ret = current.read(cbuf, off, len);
            if (ret > 0 || len == 0) {
                // If some data was read, or if no data was requested,
                // we're OK. Return the number of characters read.
                return ret;
            }
        }

        // No more data was found in the current element. Read data from
        // the next element, or return -1 if there are no more elements.
        if (iterator.hasNext()) {
            current = new StringReader(iterator.next() + '\n');
            return current.read(cbuf, off, len);
        } else {
            return -1;
        }
    
<methods>public abstract void close() throws java.io.IOException,public void mark(int) throws java.io.IOException,public boolean markSupported() ,public static java.io.Reader nullReader() ,public int read() throws java.io.IOException,public int read(java.nio.CharBuffer) throws java.io.IOException,public int read(char[]) throws java.io.IOException,public abstract int read(char[], int, int) throws java.io.IOException,public boolean ready() throws java.io.IOException,public void reset() throws java.io.IOException,public long skip(long) throws java.io.IOException,public long transferTo(java.io.Writer) throws java.io.IOException<variables>private static final int TRANSFER_BUFFER_SIZE,protected java.lang.Object lock,private static final int maxSkipBufferSize,private char[] skipBuffer