X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ffile_directories%2Finput%2Fraw%2Fclass_FrameworkRawFileInputPointer.php;h=70e00c5d2682856525f37ff665993cb73b09d723;hp=8c4f65295c97b145d9c862f5fb5c9887782a246c;hb=1a91dabdfed365947d1ce11675aacae9d424edff;hpb=e65d661719c78867ff57607457c8abfaae2e2ee3 diff --git a/inc/classes/main/file_directories/input/raw/class_FrameworkRawFileInputPointer.php b/inc/classes/main/file_directories/input/raw/class_FrameworkRawFileInputPointer.php index 8c4f6529..70e00c5d 100644 --- a/inc/classes/main/file_directories/input/raw/class_FrameworkRawFileInputPointer.php +++ b/inc/classes/main/file_directories/input/raw/class_FrameworkRawFileInputPointer.php @@ -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; }