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

Method readLines

corpus/java/training/guava/io/CharSource.java:275–290  ·  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

273 * @throws IOException if an I/O error occurs in the process of reading from this source
274 */
275 public ImmutableList<String> readLines() throws IOException {
276 Closer closer = Closer.create();
277 try {
278 BufferedReader reader = closer.register(openBufferedStream());
279 List<String> result = Lists.newArrayList();
280 String line;
281 while ((line = reader.readLine()) != null) {
282 result.add(line);
283 }
284 return ImmutableList.copyOf(result);
285 } catch (Throwable e) {
286 throw closer.rethrow(e);
287 } finally {
288 closer.close();
289 }
290 }
291
292 /**
293 * 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