code: public UnprotectedStringBuffer nextLine() throws IOException {
  		if (input.endReached()) return null;
  		UnprotectedStringBuffer line = new UnprotectedStringBuffer();
  		boolean prevCR = false;
  		do {
  			try {
  				char c = input.read();
  				if (c == '\n') break;
  				if (c == '\r' && !prevCR) {
  					prevCR = true;
  					continue;
  				}
  				if (prevCR) {
  					line.append('\r');
  					prevCR = false;
  				}
  				if (c == '\r') {
  					prevCR = true;
  					continue;
  				}
  				line.append(c);
  			} catch (EOFException e) {
  				break;
  			}
  		} while (true);
  		return line;
  	}
docs: Read a new line, return null if the end of the character stream is reached.