MCPcopy Create free account
hub / github.com/antlr/codebuff / forString

Method forString

output/java_guava/1.4.19/InetAddresses.java:146–154  ·  view source on GitHub ↗

Returns the InetAddress having the given string representation. This deliberately avoids all nameservice lookups (e.g. no DNS). @param ipString String containing an IPv4 or IPv6 string literal, e.g. "192.168.0.1" or "2001:db8::1" @return InetAddress r

(String ipString)

Source from the content-addressed store, hash-verified

144
145
146 public static InetAddress forString(String ipString) {
147 byte[] addr = ipStringToBytes(ipString);
148
149 // The argument was malformed, i.e. not an IP string literal.
150 if (addr == null) {
151 throw formatIllegalArgumentException("'%s' is not an IP string literal.", ipString);
152 }
153 return bytesToInetAddress(addr);
154 }
155
156 /**
157 * Returns {@code true} if the supplied string is a valid IP string literal, {@code false}

Callers 2

InetAddressesClass · 0.95
fromValidMethod · 0.95

Calls 3

ipStringToBytesMethod · 0.95
bytesToInetAddressMethod · 0.95

Tested by

no test coverage detected