public void addHost(String hostNameOrIpAddress) throws UnknownHostException { InetAddress address = InetAddress.getByName(hostNameOrIpAddress); hostAddresses.add(new HostAddress(address)); }
public void addHost(String hostNameOrIpAddress) throws UnknownHostException { InetAddress address = InetAddress.getByName(hostNameOrIpAddress); hostAddresses.add(new HostAddress(address)); }
/** * Compare a given {@link InetAddress} with the current HostAddress * @param address The {@link InetAddress} we want to compare with the HostAddress * @return <tt>true</tt> if they are equal */ public boolean equalsWith(InetAddress address) { if (address == null) { return false; } HostAddress that = new HostAddress(address); return equals(that); }
/** * Compare a given {@link InetAddress} with the current HostAddress * @param address The {@link InetAddress} we want to compare with the HostAddress * @return <tt>true</tt> if they are equal */ public boolean equalsWith(InetAddress address) { if (address == null) { return false; } HostAddress that = new HostAddress(address); return equals(that); }
public HostAddress readAddress() throws IOException { int typeValue = readShort(); HostAddrType addrType = HostAddrType.fromValue(typeValue); if (addrType == HostAddrType.NONE) { throw new IOException("Invalid host address type"); } byte[] addrData = readCountedOctets(); if (addrData == null) { throw new IOException("Invalid host address data"); } HostAddress addr = new HostAddress(); addr.setAddrType(addrType); addr.setAddress(addrData); return addr; }
public HostAddress readAddress() throws IOException { int typeValue = readShort(); HostAddrType addrType = HostAddrType.fromValue(typeValue); if (addrType == HostAddrType.NONE) { throw new IOException("Invalid host address type"); } byte[] addrData = readCountedOctets(); if (addrData == null) { throw new IOException("Invalid host address data"); } HostAddress addr = new HostAddress(); addr.setAddrType(addrType); addr.setAddress(addrData); return addr; }
hostAddresses = new HostAddresses(); for (InetAddress iAddr : clientAddresses) { hostAddresses.add(new HostAddress(iAddr));