Skip to content

Instantly share code, notes, and snippets.

View marcrichter's full-sized avatar

Marc Richter marcrichter

  • Den Haag
View GitHub Profile
@werbet
werbet / gist:2643813
Created May 9, 2012 11:15
Converting IPv4 address encoded as integer to string and back, in Java.
public static String integerToStringIP(int ip) {
return ((ip >> 24 ) & 0xFF) + "." +
((ip >> 16 ) & 0xFF) + "." +
((ip >> 8 ) & 0xFF) + "." +
( ip & 0xFF);
}