MCPcopy Index your code
hub / github.com/apache/groovy / readLine

Method readLine

src/main/java/groovy/io/LineColumnReader.java:154–168  ·  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. @return A String containing the contents of the line, not including any line-termination characters, or null if the e

()

Source from the content-addressed store, hash-verified

152 * or null if the end of the stream has been reached
153 */
154 @Override
155 public String readLine() throws IOException {
156 StringBuilder result = new StringBuilder();
157 for (;;) {
158 int intRead = read();
159 if (intRead == -1) {
160 return result.length() == 0 ? null : result.toString();
161 }
162
163 char c = (char)intRead;
164 if (c == '\n' || c == '\r') break;
165 result.append(c);
166 }
167 return result.toString();
168 }
169
170 /**
171 * Skips characters.

Callers 15

mainMethod · 0.45
runMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
mainMethod · 0.45
runStatementsMethod · 0.45
doCatMethod · 0.45
wcMethod · 0.45
doHeadMethod · 0.45
tailInputStreamMethod · 0.45
grepMethod · 0.45

Calls 4

readMethod · 0.95
toStringMethod · 0.65
lengthMethod · 0.45
appendMethod · 0.45