code: private synchronized int seekCountryV6(InetAddress addr) {
          byte[] v6vec = addr.getAddress();
  
          if (v6vec.length == 4) {
              // sometimes java returns an ipv4 address for IPv6 input
              // we have to work around that feature
              // It happens for ::ffff:24.24.24.24
              byte[] t = new byte[16];
              System.arraycopy(v6vec, 0, t, 12, 4);
              v6vec = t;
          }
  
          byte[] buf = new byte[2 * MAX_RECORD_LENGTH];
          int[] x = new int[2];
          int offset = 0;
          _check_mtime();
          for (int depth = 127; depth >= 0; depth--) {
              readNode(buf, x, offset);
  
              int bnum = 127 - depth;
              int idx = bnum >> 3;
              int bMask = 1 << (bnum & 7 ^ 7);
              if ((v6vec[idx] & bMask) > 0) {
                  if (x[1] >= databaseSegments[0]) {
                      last_netmask = 128 - depth;
                      return x[1];
                  }
                  offset = x[1];
              } else {
                  if (x[0] >= databaseSegments[0]) {
                      last_netmask = 128 - depth;
                      return x[0];
                  }
                  offset = x[0];
              }
          }
  
          throw new InvalidDatabaseException("Error seeking country while searching for "
                  + addr.getHostAddress());
      }
docs: Finds the country index value given an IPv6 address.
  
  @param addr
  the ip address to find in long format.
  @return the country index.