Class LineIter

All Implemented Interfaces:
IterableIter<String>, Closeable, Serializable, AutoCloseable, Iterable<String>, Iterator<String>

public class LineIter extends ComputeIter<String> implements IterableIter<String>, Closeable, Serializable
将Reader包装为一个按照行读取的Iterator
此对象遍历结束后,应关闭之,推荐使用方式:
 LineIterator it = null;
 try {
     it = new LineIterator(reader);
     while (it.hasNext()) {
         String line = it.nextLine();
         // do something with line
     }
 } finally {
     it.close();
 }
 
此类来自于Apache Commons io
Since:
4.1.1
Author:
looly
See Also: