* @return $outputStream The *real* file-output class
*/
function getOutputStream ();
+
+ /**
+ * Saves a file with data by using the current output stream
+ *
+ * @param $fileName Name of the file
+ * @param $dataStream File data stream
+ * @param $objectInstance An instance of a FrameworkInterface class (default: NULL)
+ * @return void
+ */
+ function saveStreamToFile ($fileName, $dataStream, FrameworkInterface $objectInstance = NULL);
}
// [EOF]
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Writing ' . strlen($compressedData) . ' bytes ...');
// Write this data BASE64 encoded to the file
- $this->getFileIoInstance()->saveFile($fqfn, $compressedData, $this);
+ $this->getFileIoInstance()->saveStreamToFile($fqfn, $compressedData, $this);
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file completed.');
public final function getOutputStream () {
return $this->outputStream;
}
+ /**
+ * Saves streamed (that are mostly serialized objects) data to files or
+ * external servers.
+ *
+ * @param $fileName The local file's name including full path
+ * @param $dataArray Array containing the compressor's extension and streamed data
+ * @return void
+ * @throws UnsupportedOperationException If this method is called
+ */
+ public function saveFile ($fileName, array $dataArray) {
+ self::createDebugInstance(__CLASS__)->debugOutput('fileName=' . $fileName . ',dataArray()=' . count($dataArray));
+ throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
+ }
/**
* Saves a file with data by using the current output stream
* @param $objectInstance An instance of a FrameworkInterface class (default: NULL)
* @return void
*/
- public function saveFile ($fileName, $dataStream, FrameworkInterface $objectInstance = NULL) {
+ public function saveStreamToFile ($fileName, $dataStream, FrameworkInterface $objectInstance = NULL) {
// Default is this array
$className = $this->__toString();