question: private long parseIpAddressToLong ( String address ) { long result = 0 ; String [ ] parts = address . split ( "\\." ) ; long shift = 24 ; for ( String part : parts ) { long lpart = Long . parseLong ( part ) ; result |= ( lpart << shift ) ; shift -= 8 ; } return result ; }
target:  Convert a string representation of a IP to a long.