MCPcopy Index your code
hub / github.com/antlr/codebuff / readLines

Method readLines

output/java_guava/1.4.17/CharSource.java:286–301  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

createMethod · 0.95
registerMethod · 0.95
openBufferedStreamMethod · 0.95
newArrayListMethod · 0.95
copyOfMethod · 0.95
rethrowMethod · 0.95
closeMethod · 0.95
openStreamMethod · 0.95
readLinesMethod · 0.95
readLineMethod · 0.65
addMethod · 0.65
checkNotNullMethod · 0.45

Tested by

no test coverage detected