Read the next line of input.

@return     a String containing the next line of input from the stream,
or null to indicate the end of the stream.
@exception IOException	if an input or output exception has occurred.
507827
private String readLine() throws IOException {
    StringBuffer sbuf = new StringBuffer();
    int result;
    String line;

    do {
      result = in.readLine(buf, 0, buf.length);  // does +=
      if (result != -1) {
        sbuf.append(new String(buf, 0, result, encoding));
      }
    } while (result == buf.length);  // loop only if the buffer was filled

    if (sbuf.length() == 0) {
      return null;  // nothing read, must be at the end of stream
    }

    // Cut off the trailing \n or \r\n
    // It should always be \r\n but IE5 sometimes does just \n
    // Thanks to Luke Blaikie for helping make this work with \n
    int len = sbuf.length();
    if (len >= 2 && sbuf.charAt(len - 2) == '\r') {
      sbuf.setLength(len - 2);  // cut \r\n
    }
    else if (len >= 1 && sbuf.charAt(len - 1) == '\n') {
      sbuf.setLength(len - 1);  // cut \n
    }
    return sbuf.toString();
  }
574686
public String read() throws IOException {
        StringWriter out = new StringWriter();
        PrintWriter w = new PrintWriter(out);
        try (BufferedReader in = Files.newBufferedReader(Util.fileToPath(file), StandardCharsets.UTF_8)) {
            String line;
            while ((line = in.readLine()) != null)
                w.println(line);
        } catch (Exception e) {
            throw new IOException("Failed to fully read " + file, e);
        }
        return out.toString();
    }
58487
public String nextValue() throws IOException {
        Token tkn = nextToken();
        String ret = null;
        switch (tkn.type) {
            case TT_TOKEN:
            case TT_EORECORD:
                ret = tkn.content.toString();
                break;
            case TT_EOF:
                ret = null;
                break;
            case TT_INVALID:
            default:
                // error no token available (or error)
                throw new IOException(
                        "(line " + getLineNumber() + ") invalid parse sequence");
            /// unreachable: break;
        }
        return ret;
    }
437943
public InputStream getInputStream()
    throws IOException
  {
    if (_is == null)
      _is = new FileInputStream(_file.getFD());

    return _is;
  }
258386
@Override
    @Deprecated
    public String readLine() throws IOException {
        String value = dataInput.readLine();
        if (value != null) {
            count += value.getBytes().length;
        }
        return value;
    }
197116
private String readLine() throws IOException {
        String line = input.readLine();
        lineNumber = lineNumber + 1;
        logger.debug("LINE (" + lineNumber + "): ", line);
        return line;
    }
1252683
public String[] readNext() {
    String[] result = null;
    do {
      String nextLine = getNextLine();
      if (!hasNext) { return result; // should throw if still pending?
      }
      String[] r = parser.parseLineMulti(nextLine);
      if (r.length > 0) {
        if (result == null) {
          result = r;
        } else {
          String[] t = new String[result.length + r.length];
          System.arraycopy(result, 0, t, 0, result.length);
          System.arraycopy(r, 0, t, result.length, r.length);
          result = t;
        }
      }
    } while (parser.isPending());
    return result;
  }
785509
public String readLine() throws IOException {
        StringBuffer buf = new StringBuffer(80);
        int line = mLineNumber;
        int c;
        while (line == mLineNumber && (c = read()) >= 0) {
            buf.append((char)c);
        }
        return buf.toString();
    }
583321
public boolean next() throws IOException {
		boolean hasNext = true;
		try {
			oldId = stream.readInt();
			oldText = stream.readUTFAsArray();
		} catch (EOFException e) {
			hasNext = false;
		}
		return hasNext;
	}
1310392
public String readLineUntilBoundary() throws IOException {
		StringBuilder bldr = new StringBuilder();
		while (true) {
			int b = read();
			if (bldr.indexOf(boundary) == 0) {
				leftover = ByteBuffer.wrap(boundaryBytes);
				return null;
			} else if (b == -1 || b == 10) {
				break;
			} else if (b != '\r') {
				bldr.append((char) ((byte) b));
			}
		}
		return bldr.toString();
	}
121034
def _read_next_line(self):
        """"""
        prev_line = self._line
        self._line = self.stream.readline()
        return prev_line
1166754
public String next() throws IOException {
        String result;
        int len;
        Matcher matcher;

        while (true) {
            matcher = format.separator.matcher(buffer);
            if (matcher.find()) {
                len = matcher.end();
                if (buffer.start + len == buffer.end) {
                    // make sure we match the longest separator possible
                    if (buffer.isFull()) {
                        buffer.grow();
                    }
                    buffer.fill(reader);
                    matcher = format.separator.matcher(buffer);
                    if (!matcher.find()) {
                        throw new IllegalStateException();
                    }
                    len = matcher.end();
                }
                result = new String(buffer.chars, buffer.start, format.trim == LineFormat.Trim.NOTHING ? len : matcher.start());
                buffer.start += len;
            } else {
                if (buffer.isFull()) {
                    buffer.grow();
                }
                if (buffer.fill(reader)) {
                    continue;
                } else {
                    if (buffer.isEmpty()) {
                        // EOF
                        return null;
                    } else {
                        result = buffer.eat();
                    }
                }
            }

            // always bump, even if we don't return the line 
            line++;
            if (format.trim == LineFormat.Trim.ALL) {
                result = result.trim();
            }
            if (!format.excludes.matcher(result).matches()) {
                return result;
            }
        }
    }
1167787
public Reader getReader() throws IOException {
        if (this.charset != null) {
            return new InputStreamReader(this.resource.getInputStream(), this.charset);
        } else if (this.encoding != null) {
            return new InputStreamReader(this.resource.getInputStream(), this.encoding);
        } else {
            return new InputStreamReader(this.resource.getInputStream());
        }
    }
253828
@Override
    public String readLine() throws IOException {
        StringBuilder lineBuilder = new StringBuilder();
        EditorOperation operation;
        while (true) {
            operation = readOperation();
            switch (operation.getType()) {
                case BACKSAPCE:
                case DELETE:
                    if (lineBuilder.length() > 0) {
                        lineBuilder.delete(lineBuilder.length() - 1, lineBuilder.length());
                        console.out().print(Ansi.ansi().cursorLeft(1));
                        console.out().print(" ");
                        console.out().print(Ansi.ansi().cursorLeft(1));
                    }
                    break;
                case NEWLINE:
                    return lineBuilder.toString();
                case TYPE:
                    console.out().print(operation.getInput());
                    lineBuilder.append(operation.getInput());
                    break;
            }
            flush();
        }
    }
1245290
private String readLine(InputStream in) throws IOException {
	StringBuffer buf = new StringBuffer();
	int c, length = 0;

	while(true) {
	    c = in.read();
	    if (c == -1 || c == '\n' || length > 512) {
		break;
	    } else if (c == '\r') {
		in.read();
		return buf.toString();
	    } else {
		buf.append((char)c);
		length++;
	    }

	}
	return buf.toString();
    }
543326
protected String read(InputStream inputStream) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, encoding));
        StringBuffer stringBuffer = new StringBuffer();
        String line = reader.readLine();
        while (line != null) {
            stringBuffer.append(line).append("\n");
            line = reader.readLine();
        }
        return stringBuffer.toString();
    }
362225
String parseString() throws IOException {
        buf.setLength(0);
        char next = readNext();
        while (next != '"') {
            if (next == '\\') {
                parseEscape();
            } else {
                buf.append(next);
            }
            next = readNext();
        }
        return buf.toString();
    }