I have an int which contains an IP address in network byte order, which I would like to convert to an InetAddress object. I see that there is an <
int
InetAddress
public InetAddress intToInetAddress(Integer value) throws UnknownHostException { ByteBuffer buffer = ByteBuffer.allocate(32); buffer.putInt(value); buffer.position(0); byte[] bytes = new byte[4]; buffer.get(bytes); return InetAddress.getByAddress(bytes); }