Here you can find the source of getIPv4MulticastGroup(int hash)
public static InetAddress getIPv4MulticastGroup(int hash) throws UnknownHostException
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static int[] IPV4_MULTICAST_ALLOCATION_RANGE = new int[] { /* low */ 0xE1000000, /* high */ 0xEFFFFFFF }; public static InetAddress getIPv4MulticastGroup(int hash) throws UnknownHostException { return getIPv4MulticastGroup(hash, IPV4_MULTICAST_ALLOCATION_RANGE[0], IPV4_MULTICAST_ALLOCATION_RANGE[1]); }/* w ww .j av a 2 s .c o m*/ public static InetAddress getIPv4MulticastGroup(int hash, int lowIp, int highIp) throws UnknownHostException { hash = hash & 0x7fffffff; // delete sign int port = (hash % (highIp - lowIp + 1)) + lowIp; byte[] ip = new byte[4]; for (int i = 0; i < 4; i++) ip[i] = (byte) (port >>> ((3 - i) << 3)); return InetAddress.getByAddress(ip); } }