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

Method toByteArray

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

Convert a string containing an IP address to an array of 4 or 16 bytes. @param s The address, in text format. @param family The address family. @return The address

(String s, int family)

Source from the content-addressed store, hash-verified

190 * @return The address
191 */
192public static byte []
193toByteArray(String s, int family) {
194 if (family == IPv4)
195 return parseV4(s);
196 else if (family == IPv6)
197 return parseV6(s);
198 else
199 throw new IllegalArgumentException("unknown address family");
200}
201
202/**
203 * Determines if a string contains a valid IP address.

Callers 15

getAddressBytesMethod · 0.95
fromAddressMethod · 0.95
rdataFromStringMethod · 0.95
rdataFromStringMethod · 0.95
parseV6Method · 0.95
toArrayMethod · 0.95
isDottedQuadMethod · 0.95
getByAddressMethod · 0.95
fromStringMethod · 0.95
fromStringMethod · 0.95
byteArrayFromStringMethod · 0.45

Calls 2

parseV4Method · 0.95
parseV6Method · 0.95

Tested by

no test coverage detected