]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/binary/index/class_IndexFile.php
Continued:
[core.git] / framework / main / classes / file_directories / binary / index / class_IndexFile.php
index 3de99584a81b123af3dae12f319a7f7ca0eb359f..fb95380523bde897f9ec60a1b30f44c10b1128b9 100644 (file)
@@ -160,6 +160,40 @@ class IndexFile extends BaseBinaryFile implements IndexableFile {
                return $isValid;
        }
 
+       /**
+        * Reads next "block" of bytes into $currentBlock field. THis method loads
+        * the whole file into memory when the file is just freshly initialized
+        * (only zeros in it).
+        *
+        * @return      void
+        */
+       protected function readNextBlock () {
+               // First calculate minimum block length
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: this->seekPosition=%d - CALLED!', $this->getSeekPosition()));
+               $length = $this->getIndexInstance()->calculateMinimumBlockLength();
+
+               // Call protected method
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('INDEX-FILE: Calling parent::readNextBlockByLength(%d) ...', $length));
+               parent::readNextBlockByLength($length);
+
+               // Trace message
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+       }
+
+       /**
+        * Reads the file header
+        *
+        * @return      void
+        */
+       public function readFileHeader () {
+               // Call index class' method
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: Calling this->indexInstance->readIndexHeader() - CALLED!');
+               $this->getIndexInstance()->readIndexHeader();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('INDEX-FILE: EXIT!');
+       }
+
        /**
         * Writes given value to the file and returns a hash and gap position for it
         *