public static boolean isHexDigit(final char c) {

		// I suspect most characters passed to this method will be
		// correct hexadecimal digits, so I test for the true cases
		// first. If this proves to be a performance bottleneck
		// a switch statement or lookup table
		// might optimize this.
		if (c >= '0' && c <= '9') return true;
		if (c >= 'A' && c <= 'F') return true;
		if (c >= 'a' && c <= 'f') return true;

		return false;
	}