public String readLine() throws IOException {
		final StringBuilder line = new StringBuilder(80);
		boolean isEmpty = true;
		int c = -1;

		while ((c = read()) != -1) {
			isEmpty = false;
			if (c == '\n') {
				break;
			} else if (c == '\r') {
				c = read();
				if ((c != '\n') && (c != -1)) {
					seek(getStreamPosition() - 1);
				}
				break;
			}
			line.append((char) c);
		}

		return isEmpty ? null : line.toString();
	}