]> git.mxchange.org Git - core.git/commitdiff
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 12df16c80f1eac60599d749235c0620d1075ccdc..7ed07331585fff6daf8ec7e7798c3f2409de0d0b 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 77b18e8eed421c7e575ce73dc1581bb76df5869e..4c46dca0e41cfa09e56a68cb37120bde3f5d8297 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 f8fadbde41e3ab1ea5de5dcfc04c4014214a8a48..e0c4b3dcdd71d815c5d78bcd8855bacd048da706 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]