Reads all the lines of this source as a list of strings. The returned list will be empty if this source is empty. Like BufferedReader, this method breaks lines on any of \n, \r or \r\n, does not include the line separator in the returned lines and does not conside
()
| 284 | |
| 285 | |
| 286 | public ImmutableList<String> readLines() throws IOException { |
| 287 | Closer closer = Closer.create(); |
| 288 | try { |
| 289 | BufferedReader reader = closer.register(openBufferedStream()); |
| 290 | List<String> result = Lists.newArrayList(); |
| 291 | String line; |
| 292 | while ((line = reader.readLine()) != null) { |
| 293 | result.add(line); |
| 294 | } |
| 295 | return ImmutableList.copyOf(result); |
| 296 | } catch (Throwable e) { |
| 297 | throw closer.rethrow(e); |
| 298 | } finally { |
| 299 | closer.close(); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Reads lines of text from this source, processing each line as it is read using the given |
nothing calls this directly
no test coverage detected