Reads all of the lines from a Readable object. The lines do not include line-termination characters, but do include other leading and trailing whitespace. Does not close the Readable. If reading files or resources you should use the Files#readLines and {@link Resources#re
(Readable r)
| 126 | |
| 127 | |
| 128 | public static List<String> readLines(Readable r) throws IOException { |
| 129 | List<String> result = new ArrayList<String>(); |
| 130 | LineReader lineReader = new LineReader(r); |
| 131 | String line; |
| 132 | while ((line = lineReader.readLine()) != null) { |
| 133 | result.add(line); |
| 134 | } |
| 135 | return result; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Streams lines from a {@link Readable} object, stopping when the processor returns {@code false} |
no test coverage detected