File tree Expand file tree Collapse file tree
src/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -509,19 +509,25 @@ public static List readLines(Reader input) throws IOException {
509509 //-----------------------------------------------------------------------
510510 /**
511511 * Return an Iterator for the lines in a <code>Reader</code>.
512+ * Please read the javadoc of {@link LineIterator} to understand
513+ * whether you should close the iterator.
514+ * The file is closed if an exception is thrown.
512515 *
513516 * @param reader the <code>Reader</code> to read from, not null
514517 * @return an Iterator of the lines in the reader, never null
515518 * @throws NullPointerException if the reader is null
516519 * @since Commons IO 1.2
517520 */
518- public static Iterator lineIterator (Reader reader ) {
521+ public static LineIterator lineIterator (Reader reader ) {
519522 return new LineIterator (reader );
520523 }
521524
522525 /**
523526 * Return an Iterator for the lines in an <code>InputStream</code>, using
524527 * the character encoding specified (or default encoding if null).
528+ * Please read the javadoc of {@link LineIterator} to understand
529+ * whether you should close the iterator.
530+ * The file is closed if an exception is thrown.
525531 *
526532 * @param input the <code>InputStream</code> to read from, not null
527533 * @param encoding the encoding to use, null means platform default
You can’t perform that action at this time.
0 commit comments