You are here

private function Reader::resolveDataPointer in Smart IP 7.2

Same name and namespace in other branches
  1. 6.2 includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php \MaxMind\Db\Reader::resolveDataPointer()
1 call to Reader::resolveDataPointer()
Reader::get in includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php
Looks up the <code>address</code> in the MaxMind DB.

File

includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php, line 214

Class

Reader
Instances of this class provide a reader for the MaxMind DB format. IP addresses can be looked up using the <code>get</code> method.

Namespace

MaxMind\Db

Code

private function resolveDataPointer($pointer) {
  $resolved = $pointer - $this->metadata->nodeCount + $this->metadata->searchTreeSize;
  if ($resolved > $this->fileSize) {
    throw new InvalidDatabaseException("The MaxMind DB file's search tree is corrupt");
  }
  list($data) = $this->decoder
    ->decode($resolved);
  return $data;
}