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

Method readFirstLine

corpus/java/training/guava/io/CharSource.java:252–263  ·  view source on GitHub ↗

Reads the first link of this source as a string. Returns null 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 line and does not consider there to be an ext

()

Source from the content-addressed store, hash-verified

250 * @throws IOException if an I/O error occurs in the process of reading from this source
251 */
252 @Nullable
253 public String readFirstLine() throws IOException {
254 Closer closer = Closer.create();
255 try {
256 BufferedReader reader = closer.register(openBufferedStream());
257 return reader.readLine();
258 } catch (Throwable e) {
259 throw closer.rethrow(e);
260 } finally {
261 closer.close();
262 }
263 }
264
265 /**
266 * Reads all the lines of this source as a list of strings. The returned list will be empty if

Callers

nothing calls this directly

Calls 6

createMethod · 0.95
registerMethod · 0.95
openBufferedStreamMethod · 0.95
rethrowMethod · 0.95
closeMethod · 0.95
readLineMethod · 0.65

Tested by

no test coverage detected