@Override
	public boolean hasNext() {
		if (reader == null) return false; // No input stream?

		if (next == null) {
			next = readNext(); // Try reading next item.
			if ((next == null) && autoClose) close(); // End of file or any problem? => Close file
		}

		return (next != null);
	}