You are here

private function Decoder::decodePointer in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php \MaxMind\Db\Reader\Decoder::decodePointer()
1 call to Decoder::decodePointer()
Decoder::decode in includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Decoder.php

File

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

Class

Decoder

Namespace

MaxMind\Db\Reader

Code

private function decodePointer($ctrlByte, $offset) {
  $pointerSize = ($ctrlByte >> 3 & 0x3) + 1;
  $buffer = Util::read($this->fileStream, $offset, $pointerSize);
  $offset = $offset + $pointerSize;
  $packed = $pointerSize == 4 ? $buffer : pack('C', $ctrlByte & 0x7) . $buffer;
  $unpacked = $this
    ->decodeUint($packed);
  $pointer = $unpacked + $this->pointerBase + $this->pointerValueOffset[$pointerSize];
  return array(
    $pointer,
    $offset,
  );
}