public static InetAddress intToInetAddress(int hostAddress){
  if (hostAddress == 0)   return null;
  byte[] addressBytes={(byte)(0xff & hostAddress),(byte)(0xff & (hostAddress >> 8)),(byte)(0xff & (hostAddress >> 16)),(byte)(0xff & (hostAddress >> 24))};
  try {
    return InetAddress.getByAddress(addressBytes);
  }
 catch (  UnknownHostException e) {
    throw new AssertionError();
  }
}

public static InetAddress intToInetAddress ( int hostAddress ) { if ( hostAddress == 0 ) return null ; byte [ ] addressBytes = { ( byte ) ( 0xff & hostAddress ) , ( byte ) ( 0xff & ( hostAddress > > 8 ) ) , ( byte ) ( 0xff & ( hostAddress > > 16 ) ) , ( byte ) ( 0xff & ( hostAddress > > 24 ) ) } ; try { return InetAddress . getByAddress ( addressBytes ) ; } catch ( UnknownHostException e ) { throw new AssertionError ( ) ; } }
convert a ipv4 address from an integer to an inetaddress .
