*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
*
* @return $seekPosition Current seek position (stored here in object)
*/
- protected final function getSeekPosition () {
+ public final function getSeekPosition () {
// Get it
return $this->seekPosition;
}
// ... to write it back into the file
$this->flushFileHeader();
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
}
/**
// Seek to currently ("old") saved position
$this->seek($this->getSeekPosition());
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
}
/**
* @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
// Rewind seek position (to beginning of file) and update/flush file header
$this->rewindUpdateSeekPosition();
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!!', __METHOD__, __LINE__));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
}
/**
* @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));
+
// Call pointer instance
return $this->getPointerInstance()->read($bytes);
}