+ // Get a file i/o pointer instance for index file
+ $fileInstance = ObjectFactory::createObjectByConfiguredName('index_file_class', array($fileName, $this));
+
+ // Get iterator instance
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('file_iterator_class', array($fileInstance));
+
+ // Is the instance implementing the right interface?
+ assert($iteratorInstance instanceof SeekableWritableFileIterator);
+
+ // Set iterator here
+ $this->setIteratorInstance($iteratorInstance);
+
+ // Calculate header size
+ $this->getIteratorInstance()->setHeaderSize(
+ strlen(self::INDEX_MAGIC) +
+ strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_DATA)) +
+ BaseBinaryFile::LENGTH_COUNT +
+ strlen(chr(BaseBinaryFile::SEPARATOR_HEADER_ENTRIES))
+ );