public static byte[] textToNumericFormat(String src) {
		if (src == null || src.length() == 0) {
			return null;
		}
		int octets;
		char ch;
		byte[] dst = new byte[INADDRSZ];
		char[] srcb = src.toCharArray();
		boolean sawDigit = false;

		octets = 0;
		int i = 0;
		int cur = 0;
		while (i < srcb.length) {
			ch = srcb[i++];
			if (Character.isDigit(ch)) {
				int sum = dst[cur] * 10 + (Character.digit(ch, 10) & 0xff);

				if (sum > 255) {
					return null;
				}
				dst[cur] = (byte) (sum & 0xff);
				if (!sawDigit) {
					if (++octets > INADDRSZ) {
						return null;
					}
					sawDigit = true;
				}
			} else if (ch == '.' && sawDigit) {
				if (octets == INADDRSZ) {
					return null;
				}
				cur++;
				dst[cur] = 0;
				sawDigit = false;
			} else {
				return null;
			}
		}

		if (octets < INADDRSZ) {
			return null;
		}
		return dst;
	}
Converts IPv4 address in its textual presentation form into its numeric binary form.

@param src
           a String representing an IPv4 address in standard format
@return a byte array representing the IPv4 numeric address
ngrinder-runtime/src/main/java/org/ngrinder/dns/DnsUtils.java