private function parseBlockTable() { $hashing = new FileKeyHashing(); $encryptedStream = new EncryptedStream($this->stream, new DefaultEncryption($hashing->hash('(block table)'))); $parser = new BinaryStreamParser($encryptedStream); $parser->seek($this->getUserDataOffset() + $this->getHeader()->getBlockTablePos()); $blocks = array(); // $offsetFix = 0; for ($i = 0; $i < $this->getHeader()->getBlockTableSize(); $i++) { $block = $blocks[$i] = Block::parse($parser); // if($block->getSize() == 0) { // $offsetFix++; // } } return new BlockTable($blocks); }
public function testExistsFlag() { $parser = $this->createMemoryParser(hex2bin(self::TEST_EXISTS_BLOCK_DATA)); $block = Block::parse($parser); $this->assertEquals(true, $block->isExisting()); }