protected function readSectionSize(SeekableIterator $it) { $it->seek($this->start_line); if (!$it->valid()) { throw new phpMorphy_Mrd_Exception("Can`t read section size, iterator not valid"); } $size = trim($it->current()); if (!preg_match('~^[0-9]+$~', $size)) { throw new phpMorphy_Mrd_Exception("Invalid section size: {$size}"); } return (int) $size; }
/** * Seeks the pointer. * * @param int $pointer */ public function seek($pointer) { $this->iterator->seek($pointer); }