private long toLong(InetAddress inetAddress){
  byte[] address=inetAddress.getAddress();
  long result=0;
  for (int i=0; i < address.length; i++) {
    result<<=8;
    result|=address[i] & BYTE_MASK;
  }
  return result;
}

private long toLong ( InetAddress inetAddress ) { byte [ ] address = inetAddress . getAddress ( ) ; long result = 0 ; for ( int i = 0 ; i < address . length ; i ++ ) { result <<= 8 ; result |= address [ i ] & BYTE_MASK ; } return result ; }
converts an ip address into a long
