The first method, toLong(String), will convert the provided ip address to its long format. For instance, invoking toLong("255.255.255.255") will return 4294967295 whereas the second method, toString(long), will convert it back as "255.255.255.255", in other words, into a 32bit dotted format.