23 else if (
self is
java.net.Inet6Address ip6)
24 return new IPAddress(
self.getAddress(), ip6.getScopeId());
26 return new IPAddress(
self.getAddress());
34 public static java.net.InetAddress
ToInetAddress(
this IPAddress address)
36 return address !=
null ? address.ToInetAddress(address.ToString()) :
null;
45 public static java.net.InetAddress
ToInetAddress(
this IPAddress address,
string hostname)
49 else if (address.IsIPv6LinkLocal || address.IsIPv6SiteLocal)
50 return java.net.Inet6Address.getByAddress(hostname, address.GetAddressBytes(), (
int)address.ScopeId);
52 return java.net.InetAddress.getByAddress(hostname, address.GetAddressBytes());
62 return self !=
null ?
self.Address.ToInetAddress() :
null;
Extension methods for working with Internet Addrsses.
static java.net.InetAddress ToInetAddress(this IPAddress address, string hostname)
Gets a java.net.InetAddress for the given IPAddress.
static IPAddress ToIPAddress(this java.net.InetAddress self)
Gets a IPAddress for the given java.net.InetAddress.
static java.net.InetAddress ToInetAddress(this IPEndPoint self)
Gets a java.net.InetAddress for the given IPEndPoint.
static java.net.InetAddress ToInetAddress(this IPAddress address)
Gets a java.net.InetAddress for the given IPAddress.