Here you can find the source of convertLongToInetAddress(long address)
public static InetAddress convertLongToInetAddress(long address) throws UnknownHostException
//package com.java2s; /*//from ww w. java 2s . c o m * IRClib -- A Java Internet Relay Chat library -- class IRCConnection * Copyright (C) 2002 - 2006 Christoph Schwering <schwering@gmail.com> * * This library and the accompanying materials are made available under the * terms of the * - GNU Lesser General Public License, * - Apache License, Version 2.0 and * - Eclipse Public License v1.0. * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY. */ import java.net.InetAddress; import java.net.UnknownHostException; public class Main { public static InetAddress convertLongToInetAddress(long address) throws UnknownHostException { byte[] addr = new byte[4]; addr[0] = (byte) ((address >>> 24) & 0xFF); addr[1] = (byte) ((address >>> 16) & 0xFF); addr[2] = (byte) ((address >>> 8) & 0xFF); addr[3] = (byte) (address & 0xFF); return InetAddress.getByAddress(addr); } }