]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/file_directories/input/raw/class_FrameworkRawFileInputPointer.php
Continued CSV parsing:
[core.git] / inc / classes / main / file_directories / input / raw / class_FrameworkRawFileInputPointer.php
index 8c4f65295c97b145d9c862f5fb5c9887782a246c..70e00c5d2682856525f37ff665993cb73b09d723 100644 (file)
@@ -93,19 +93,30 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
                return $this->read(1024);
        }
 
+       /**
+        * Reads a line, maximum 4096 Bytes from current file pointer
+        *
+        * @return      $data   Read data from file
+        * @throws      UnsupportedOperationException   If this method is called
+        */
+       public function readLine () {
+               // Not supported in binary files ...
+               throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+       }
+
        /**
         * Reads given amount of bytes from file.
         *
         * @param       $bytes  Amount of bytes to read
         * @return      $data   Data read from file
         */
-       public function read ($bytes) {
+       public function read ($bytes = NULL) {
+               // $bytes shall be integer
+               assert(is_int($bytes));
+
                // Try to read given characters
                $data = fread($this->getPointer(), $bytes);
 
-               // Was this successfull?
-               assert(is_string($data));
-
                // Then return it
                return $data;
        }