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
Please register or sign in to comment