RTEditor/src/main/java/com/onegravity/rteditor/utils/io/IOUtils.java
public static LineIterator lineIterator(InputStream input, String encoding) throws IOException {
        return lineIterator(input, Charsets.toCharset(encoding));
    }
public static LineIterator lineIterator(InputStream input, String encoding) throws IOException {
        return lineIterator(input, Charsets.toCharset(encoding));
    }
public static LineIterator lineIterator ( InputStream input , String encoding ) throws IOException { return lineIterator ( input , Charsets . toCharset ( encoding ) ) ; }
Return an Iterator for the lines in an <code>InputStream</code>, using
the character encoding specified (or default encoding if null).
<p/>
<code>LineIterator</code> holds a reference to the open
<code>InputStream</code> specified here. When you have finished with
the iterator you should close the stream to free internal resources.
This can be done by closing the stream directly, or by calling
{@link LineIterator#close()} or {@link LineIterator#closeQuietly(LineIterator)}.
<p/>
The recommended usage pattern is:
<pre>
try {
LineIterator it = IOUtils.lineIterator(stream, "UTF-8");
while (it.hasNext()) {
String line = it.nextLine();
/// do something with line
}
} finally {
IOUtils.closeQuietly(stream);
}
</pre>

@param input    the <code>InputStream</code> to read from, not null
@param encoding the encoding to use, null means platform default
@return an Iterator of the lines in the reader, never null
@throws IllegalArgumentException    if the input is null
@throws IOException                 if an I/O error occurs, such as if the encoding is invalid
@throws UnsupportedCharsetException thrown instead of {@link UnsupportedEncodingException} in version 2.2 if the encoding is not
supported.
@since 1.2
Return an Iterator for the lines in an <code > InputStream< / code > using the character encoding specified ( or default encoding if null ) . <p / > <code > LineIterator< / code > holds a reference to the open <code > InputStream< / code > specified here . When you have finished with the iterator you should close the stream to free internal resources . This can be done by closing the stream directly or by calling { @link LineIterator#close () } or { @link LineIterator#closeQuietly ( LineIterator ) } . <p / > The recommended usage pattern is : <pre > try { LineIterator it = IOUtils . lineIterator ( stream UTF - 8 ) ; while ( it . hasNext () ) { String line = it . nextLine () ; /// do something with line } } finally { IOUtils . closeQuietly ( stream ) ; } < / pre >