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

Method readLine

output/java_guava/1.4.19/LineReader.java:71–86  ·  view source on GitHub ↗

Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed ("\r\n"). @return a String containing the contents of the line, not including any line-

()

Source from the content-addressed store, hash-verified

69 */
70
71 @CanIgnoreReturnValue // to skip a line
72 public String readLine() throws IOException {
73 while (lines.peek() == null) {
74 cbuf.clear();
75 // The default implementation of Reader#read(CharBuffer) allocates a
76 // temporary char[], so we call Reader#read(char[], int, int) instead.
77
78 int read = (reader != null) ? reader.read(buf, 0, buf.length) : readable.read(cbuf);
79 if (read == -1) {
80 lineBuf.finish();
81 break;
82 }
83 lineBuf.add(buf, 0, read);
84 }
85 return lines.poll();
86 }
87}

Callers 1

readLinesMethod · 0.95

Calls 6

peekMethod · 0.65
clearMethod · 0.65
addMethod · 0.65
readMethod · 0.45
finishMethod · 0.45
pollMethod · 0.45

Tested by

no test coverage detected