private byte[] tryDecodeHostToIp(String host){
  if (host.startsWith("[") && host.endsWith("]")) {
    return tryDecodeHostToIPv6(host);
  }
  return tryDecodeHostToIPv4(host);
}

private byte [ ] tryDecodeHostToIp ( String host ) { if ( host . startsWith ( "[" ) && host . endsWith ( "]" ) ) { return tryDecodeHostToIPv6 ( host ) ; } return tryDecodeHostToIPv4 ( host ) ; }
checks if the host is an ip address . returns the byte representation of it
