If you're using Google's Guava libraries, InetAddresses.fromInteger does exactly what you want. Api docs are here
If you'd rather write your own conversion function, you can do something like what @aalmeida suggests, except be sure to put the bytes in the right order (most significant byte first).