public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } return seekCountry(ipAddress) - databaseSegments[0]; }
/** * Returns the country the IP address is in. * * @param ipAddress * the IP address in long format. * @return the country the IP address is from. */ public synchronized Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
int seek_region; if (databaseType == DatabaseInfo.REGION_EDITION_REV0) { seek_region = seekCountry(ipnum) - STATE_BEGIN_REV0; char[] ch = new char[2]; if (seek_region >= 1000) { seek_region = seekCountry(ipnum) - STATE_BEGIN_REV1; char[] ch = new char[2]; if (seek_region < US_OFFSET) {
public synchronized Location getLocation(long ipnum) { int seek_country; try { seek_country = seekCountry(ipnum); return readCityRecord(seek_country); } catch (IOException e) { throw new InvalidDatabaseException("Error while seting up segments", e); } }
public synchronized String getOrg(long ipnum) { try { int seekOrg = seekCountry(ipnum); return readOrgRecord(seekOrg); } catch (IOException e) { throw new InvalidDatabaseException("Error while reading org", e); } }
public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } return seekCountry(ipAddress) - databaseSegments[0]; }
public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - databaseSegments[0]; return ret; }
public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - databaseSegments[0]; return ret; }
public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } return seekCountry(ipAddress) - databaseSegments[0]; }
public synchronized int getID(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - databaseSegments[0]; return ret; }
/** * Returns the country the IP address is in. * * @param ipAddress the IP address in long format. * @return the country the IP address is from. */ public Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
/** * Returns the country the IP address is in. * * @param ipAddress the IP address in long format. * @return the country the IP address is from. */ public Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
/** * Returns the country the IP address is in. * * @param ipAddress * the IP address in long format. * @return the country the IP address is from. */ public synchronized Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
/** * Returns the country the IP address is in. * * @param ipAddress the IP address in long format. * @return the country the IP address is from. */ public Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
/** * Returns the country the IP address is in. * * @param ipAddress * the IP address in long format. * @return the country the IP address is from. */ public synchronized Country getCountry(long ipAddress) { if (file == null && (dboptions & GEOIP_MEMORY_CACHE) == 0) { throw new IllegalStateException("Database has been closed."); } int ret = seekCountry(ipAddress) - COUNTRY_BEGIN; if (ret == 0) { return UNKNOWN_COUNTRY; } else { return new Country(countryCode[ret], countryName[ret]); } }
seek_org = seekCountry(ipnum); if (seek_org == databaseSegments[0]) { return null;
public synchronized Location getLocation(long ipnum) { int seekCountry; try { seekCountry = seekCountry(ipnum); return readCityRecord(seekCountry); } catch (IOException e) { throw new InvalidDatabaseException("Error while seting up segments", e); } }
public synchronized Location getLocation(long ipnum) { int seek_country; try { seek_country = seekCountry(ipnum); return readCityRecord(seek_country); } catch (IOException e) { throw new InvalidDatabaseException("Error while seting up segments", e); } }
public synchronized String getOrg(long ipnum) { try { int seekOrg = seekCountry(ipnum); return readOrgRecord(seekOrg); } catch (IOException e) { throw new InvalidDatabaseException("Error while reading org", e); } }
public synchronized String getOrg(long ipnum) { try { int seekOrg = seekCountry(ipnum); return readOrgRecord(seekOrg); } catch (IOException e) { throw new InvalidDatabaseException("Error while reading org", e); } }