MCPcopy Create free account
hub / github.com/antlr/codebuff / readLines

Method readLines

corpus/java/training/guava/io/CharStreams.java:121–129  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

119 * @throws IOException if an I/O error occurs
120 */
121 public static List<String> readLines(Readable r) throws IOException {
122 List<String> result = new ArrayList<String>();
123 LineReader lineReader = new LineReader(r);
124 String line;
125 while ((line = lineReader.readLine()) != null) {
126 result.add(line);
127 }
128 return result;
129 }
130
131 /**
132 * Streams lines from a {@link Readable} object, stopping when the processor returns {@code false}

Callers 1

readLinesMethod · 0.95

Calls 5

readLineMethod · 0.95
addMethod · 0.65
processLineMethod · 0.65
getResultMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected