Code example for UnknownHostException

0
	private Short port;
	 
	public Location(byte[] address, Short port)
	throws UnknownHostException, InvalidLocationException { 
		if (address.length != 4) {
			throw new UnknownHostException("Must be an IPv4 Address");
		} 
		if (port > 65535 || port < 1) {
			throw new InvalidLocationException(); 
		} 
		this.address = (Inet4Address) InetAddress.getByAddress(address);
	} 
	 
	public Location(Inet4Address address, Short port)
	throws InvalidLocationException { 
		if (port > 65535 || port < 1) {
			throw new InvalidLocationException(); 
		} 
		this.address = address;
		this.port = port;
	}