]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/file_directories/io/class_FrameworkFileInputOutputPointer.php
Continued with file-based hash:
[core.git] / inc / classes / main / file_directories / io / class_FrameworkFileInputOutputPointer.php
index 078c206be29400b5aee821748067a73f2827630d..cebb1fad9229640ca38b27f845fe6a8f9cbb6a03 100644 (file)
@@ -115,7 +115,29 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                }
 
                // Write data to the file pointer and return written bytes
-               return fwrite($this->getPointer(), $dataStream);
+               return fwrite($this->getPointer(), $dataStream, strlen($dataStream));
+       }
+
+       /**
+        * Rewinds to the beginning of the file
+        *
+        * @return      void
+        */
+       public function rewind () {
+               // Rewind the pointer
+               assert(rewind($this->getPointer() === 1);
+       }
+
+       /**
+        * Seeks to given position
+        *
+        * @param       $seekPosition   Seek position in file
+        * @param       $whence                 "Seek mode" (see http://de.php.net/fseek)
+        * @return      void
+        */
+       public function seek ($seekPosition, $whence = SEEK_SET) {
+               // Move the file pointer
+               assert(fseek($this->getPointerInstance(), $seekPosition, $whence) === 0);
        }
 }