code: private int toInt(InetAddress inetAddress) {
          byte[] address = inetAddress.getAddress();
          int result = 0;
          for (int i = 0; i < address.length; i++) {
              result <<= 8;
              result |= address[i] & BYTE_MASK;
          }
          return result;
      }
docs: Converts an IP address into an integer