MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / getByAddress

Method getByAddress

src/main/java/core/org/xbill/DNS/Address.java:316–326  ·  view source on GitHub ↗

Converts an address from its string representation to an IP address. The address can be either IPv4 or IPv6. @param addr The address, in string form @return The IP addresses @exception UnknownHostException The address is not a valid IP address.

(String addr)

Source from the content-addressed store, hash-verified

314 * @exception UnknownHostException The address is not a valid IP address.
315 */
316public static InetAddress
317getByAddress(String addr) throws UnknownHostException {
318 byte [] bytes;
319 bytes = toByteArray(addr, IPv4);
320 if (bytes != null)
321 return InetAddress.getByAddress(addr, bytes);
322 bytes = toByteArray(addr, IPv6);
323 if (bytes != null)
324 return InetAddress.getByAddress(addr, bytes);
325 throw new UnknownHostException("Invalid address: " + addr);
326}
327
328/**
329 * Converts an address from its string representation to an IP address in

Callers 15

getAddressMethod · 0.95
getByNameMethod · 0.95
getAllByNameMethod · 0.95
rdataFromStringMethod · 0.95
rrFromWireMethod · 0.80
rrFromWireMethod · 0.80
rdataFromStringMethod · 0.80
rrToStringMethod · 0.80
getAddressMethod · 0.80
optionFromWireMethod · 0.80
getAddressMethod · 0.80
addrFromRecordMethod · 0.80

Calls 1

toByteArrayMethod · 0.95

Tested by

no test coverage detected