public function parse() { if ($this->isParsed()) { return; } $parser = new BinaryStreamParser($this->stream); $signature = $this->parseSignature($parser); if ($signature == "MPQ27") { $this->userData = UserData::parse($parser); $this->stream->seek($this->getUserDataOffset()); $signature = $this->parseSignature($parser); } if ($signature == "MPQ26") { $this->header = Header::parse($parser); } $this->hashTable = $this->parseHashTable(); $this->blockTable = $this->parseBlockTable(); $this->parsed = true; }
/** * {@inheritdoc} */ public function seek($position) { $this->stream->seek($position); }
/** * {@inheritdoc} */ public function seek($position) { $this->stream->seek($position); $this->bufferPointer = 0xff; }
private function readSector(Sector $sector) { $this->stream->seek($this->file->getUserDataOffset() + $this->block->getFilePos() + $sector->getStart()); $compressedStream = $this->createCompressedStream($sector); return $compressedStream->readBytes($this->block->getSize()); }