IP2Location.php
private function read($pos, $len) {
    switch ($this->mode) {
      case self::SHARED_MEMORY:
        return shmop_read($this->resource, $pos, $len);

      case self::MEMORY_CACHE:
        return $data = substr(self::$buffer[$this->resource], $pos, $len);

      default:
        fseek($this->resource, $pos, SEEK_SET);
        return fread($this->resource, $len);
    }
  }
private function read($pos, $len) {
    switch ($this->mode) {
      case self::SHARED_MEMORY:
        return shmop_read($this->resource, $pos, $len);

      case self::MEMORY_CACHE:
        return $data = substr(self::$buffer[$this->resource], $pos, $len);

      default:
        fseek($this->resource, $pos, SEEK_SET);
        return fread($this->resource, $len);
    }
  }
private function read ( $ pos , $ len ) { switch ( $ this -> mode ) { case self :: SHARED_MEMORY : return shmop_read ( $ this -> resource , $ pos , $ len ) ; case self :: MEMORY_CACHE : return $ data = substr ( self :: $ buffer [ $ this -> resource ] , $ pos , $ len ) ; default : fseek ( $ this -> resource , $ pos , SEEK_SET ) ; return fread ( $ this -> resource , $ len ) ; } }
Low level read function to abstract away the caching mode being used

@access private
@param int $pos  Position from where to start reading
@param int $len  Read this many bytes
@return string
Low level read function to abstract away the caching mode being used