Introduced isEndOfFileReached() + added a noisy debug line.
[core.git] / inc / classes / main / iterator / io / class_FileIoIterator.php
index 7f30fb514f1577c829b7d57eeb01f53512bf98d2..97a3e3d4abf18195ca582daf231390e52cc6a88e 100644 (file)
@@ -150,9 +150,10 @@ class FileIoIterator extends BaseIterator implements SeekableWritableFileIterato
 
                // Wait until a entry/block separator has been found
                $data = $this->getBackBuffer();
-               while (!$this->getBlockInstance()->isBlockSeparatorFound($data)) {
+               while (($this->getPointerInstance()->isEndOfFileReached()) && (!$this->getBlockInstance()->isBlockSeparatorFound($data)) {
                        // Then read the block
                        $data .= $this->read($length);
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('data()=' . strlen($data));
                } // END - if
 
                /*