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;
}