@Override
	public int next() throws IOException {
		int n = -1;
		if ((n = get()) != -1) {
			offset++;
			if (n == '\r') {
				lines++;
				columns = 0;
			} else if (n == '\n') {
				if (start < 2 || buf[start-2] != '\r') {
					lines++;
					columns = 0;
				}
			} else {
				columns++;
			}
		}
		return n;
	}