private Object readResolve() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private static void collectIpv4Address(String interfaceName, List<InetAddress> addresses, List<InterfaceAddress> interfaceAddresses) throws SocketException { // RoboVM note: This method used to use ioctl to probe a socket, this failed in various // ways on Darwin. byte[] bytes = getIpv4Addresses(interfaceName); if (bytes != null) { for (int i = 0; i < bytes.length; i += 12) { Inet4Address address = new Inet4Address( new byte[] { bytes[i + 0], bytes[i + 1], bytes[i + 2], bytes[i + 3] }, null); Inet4Address netmask = new Inet4Address( new byte[] { bytes[i + 4], bytes[i + 5], bytes[i + 6], bytes[i + 7] }, null); Inet4Address broadcast = new Inet4Address( new byte[] { bytes[i + 8], bytes[i + 9], bytes[i + 10], bytes[i + 11] }, null); addresses.add(address); interfaceAddresses.add(new InterfaceAddress(address, broadcast, netmask)); } } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress getByAddress(String hostName, byte[] ipAddress, int scopeId) throws UnknownHostException { if (ipAddress == null) { throw new UnknownHostException("ipAddress == null"); } if (ipAddress.length == 4) { return new Inet4Address(ipAddress.clone(), hostName); } else if (ipAddress.length == 16) { // First check to see if the address is an IPv6-mapped // IPv4 address. If it is, then we can make it a IPv4 // address, otherwise, we'll create an IPv6 address. if (isIPv4MappedAddress(ipAddress)) { return new Inet4Address(ipv4MappedToIPv4(ipAddress), hostName); } else { return new Inet6Address(ipAddress.clone(), hostName, scopeId); } } else { throw badAddressLength(ipAddress); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object readResolve() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object readResolve() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object readResolve() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
private Object writeReplace() throws ObjectStreamException { return new Inet4Address(ipaddress, hostName); } }
int addressType = InetAddress.getAddressType(address); InetAddress ia = null; switch (addressType) { case V4 : ia = new Inet4Address(); break; case V6 : ia = new Inet6Address(); break; default : throw new RuntimeException("bad address"); }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }
private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException { if (bytes.length == 4) { return new Inet4Address(bytes, hostName); } else if (bytes.length == 16) { return new Inet6Address(bytes, hostName, 0); } else { throw badAddressLength(bytes); } }