writeData() also belongs here.
authorRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 21:20:53 +0000 (23:20 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 23 Jun 2014 21:20:53 +0000 (23:20 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/interfaces/iterator/class_SeekableWritableFileIterator.php
inc/classes/main/file_directories/binary/class_BaseBinaryFile.php
inc/classes/main/iterator/file/class_FileIterator.php

index 12df16c..7ed0733 100644 (file)
@@ -137,6 +137,16 @@ interface SeekableWritableFileIterator extends SeekableIterator {
         * @return      $fileSize       Size of currently loaded file
         */
        function getFileSize ();
+
+       /**
+        * Writes data at given position
+        *
+        * @param       $seekPosition   Seek position
+        * @param       $data                   Data to be written
+        * @param       $flushHeader    Whether to flush the header (default: flush)
+        * @return      void
+        */
+       function writeData ($seekPosition, $data, $flushHeader = TRUE);
 }
 
 // [EOF]
index 77b18e8..4c46dca 100644 (file)
@@ -390,7 +390,7 @@ class BaseBinaryFile extends BaseFile {
         * @param       $flushHeader    Whether to flush the header (default: flush)
         * @return      void
         */
-       protected function writeData ($seekPosition, $data, $flushHeader = TRUE) {
+       public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%s - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data)));
 
                // Write data at given position
index f8fadbd..e0c4b3d 100644 (file)
@@ -263,6 +263,19 @@ class FileIterator extends BaseIterator implements SeekableWritableFileIterator
                // Call block instance
                return $this->getBlockInstance()->getFileSize();
        }
+
+       /**
+        * Writes data at given position
+        *
+        * @param       $seekPosition   Seek position
+        * @param       $data                   Data to be written
+        * @param       $flushHeader    Whether to flush the header (default: flush)
+        * @return      void
+        */
+       public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
+               // Call block instance
+               $this->getBlockInstance()->writeData($seekPosition, $data, $flushHeader);
+       }
 }
 
 // [EOF]