Skip to content
Commit 145c606e authored by Daniel Trebbien's avatar Daniel Trebbien Committed by Oleg Nenashev
Browse files

Refactor TextFile.lines() (#3211)

* Refactor TextFile.lines()

Introduces a LinesStream utility class that is responsible for closing
the underlying file handle.

Switches to calling Files.newBufferedReader() instead of wrapping the
InputStream returned by Files.newInputStream() in a BufferedReader of
an InputStreamReader.

Creates the file reader at the time that lines() is invoked, instead of
at the time that iterator() of the returned Iterable is invoked. This
can help prevent confusion as to the cause of an exception, whether it's
because of a problem opening the file or reading from it.

* Delete a duplicate import and a now-unused import

* Introduce load2()

* Add a @Deprecated annotation
parent 93b95104
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment