public static InetAddress hexToInet6Address(String addrHexString) throws IllegalArgumentException {
  try {
    return numericToInetAddress(String.format("%s:%s:%s:%s:%s:%s:%s:%s",addrHexString.substring(0,4),addrHexString.substring(4,8),addrHexString.substring(8,12),addrHexString.substring(12,16),addrHexString.substring(16,20),addrHexString.substring(20,24),addrHexString.substring(24,28),addrHexString.substring(28,32)));
  }
 catch (  Exception e) {
    Log.e("NetworkUtils","error in hexToInet6Address(" + addrHexString + "): "+ e);
    throw new IllegalArgumentException(e);
  }
}

public static InetAddress hexToInet6Address ( String addrHexString ) throws IllegalArgumentException { try { return numericToInetAddress ( String . format ( "%s:%s:%s:%s:%s:%s:%s:%s" , addrHexString . substring ( 0 , 4 ) , addrHexString . substring ( 4 , 8 ) , addrHexString . substring ( 8 , 12 ) , addrHexString . substring ( 12 , 16 ) , addrHexString . substring ( 16 , 20 ) , addrHexString . substring ( 20 , 24 ) , addrHexString . substring ( 24 , 28 ) , addrHexString . substring ( 28 , 32 ) ) ) ; } catch ( Exception e ) { Log . e ( "NetworkUtils" , "error in hexToInet6Address(" + addrHexString + "): " + e ) ; throw new IllegalArgumentException ( e ) ; } }
convert a 32 char hex string into a inet6address . throws a runtime exception if the string isn ' t 32 chars , isn ' t hex or can ' t be made into an inet6address
