3 * Null compression and decompression class
5 class NullCompressor extends BaseFrameworkSystem implements Compressor {
11 private function __construct () {
12 // Call parent constructor!
13 parent::constructor(__CLASS__);
16 if (((defined('DEBUG_COMPRESSOR')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:] Konstruktor erreicht.<br />\n",
21 $this->setPartDescr("Null-Kompressor");
23 // Create an unique ID
24 $this->createUniqueID();
28 * Create a new compressor channel based a given compression handler
30 * @return $cInstance An instance of this class
32 public final static function createNullCompressor () {
34 $cInstance = new NullCompressor();
36 // Return the compressor instance
41 * Null compression stream
43 * @param $streamData Mixed non-object stream data
44 * @return $streamData The compressed stream data
45 * @throws InvalidObjectException If the stream is an object
47 public function compressStream ($streamData) {
48 if (is_object($streamData)) {
50 throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
53 // Return the compressed stream
58 * Null decompression stream
60 * @param $streamData Mixed non-object stream data
61 * @return $streamData The decompressed stream data
62 * @throws InvalidObjectException If the stream is an object
64 public function decompressStream ($streamData) {
65 if (is_object($streamData)) {
67 throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
70 // Return the decompressed stream
75 * Getter for the file extension of this compressor
77 * @return $string Returns always "bz2"
79 public final function getCompressorExtension () {
80 if ((defined('DEBUG_COMPRESSOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Dateierweiterung angefordert.<br />\n",