Here you can find the source of intToInetAddress(int i)
public static InetAddress intToInetAddress(int i) throws UnknownHostException
//package com.java2s; //License from project: Apache License import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static InetAddress intToInetAddress(int i) throws UnknownHostException { return InetAddress.getByAddress(intToAddress(i)); }/*from w ww . j a va 2s. c o m*/ public static byte[] intToAddress(int i) { return new byte[] { (byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF) }; } }