List of utility methods to do InetAddress
int | sortKey(InetAddress address, boolean prefer_v6) Sorts an address by preference. int key = address.getAddress().length; if (prefer_v6) { key = -key; if (address.isAnyLocalAddress()) { key += 5; if (address.isMulticastAddress()) { ... |
String | toStringWithNoHostname(InetAddress address) to String With No Hostname String addr = address.toString(); int i = addr.indexOf('/'); if (i == -1) { throw new IllegalArgumentException("InetAddress does not contain / character"); return addr.substring(i + 1, addr.length()); |
void | writeInetAddress(final InetAddress inetAddress, final DataOutput out, final boolean fixedLength) write Inet Address if (inetAddress == null) { out.writeBoolean(true); if (fixedLength) { out.writeByte(0); out.writeLong(0); out.writeLong(0); } else { ... |