3 namespace Org\Mxchange\CoreFramework\Compressor\Null;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Compressor\Compressor;
7 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
10 * Null compression and decompression class
12 * @author Roland Haeder <webmaster@shipsimu.org>
14 <<<<<<< HEAD:framework/main/classes/compressor/class_NullCompressor.php
15 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
17 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
18 >>>>>>> Some updates::inc/main/classes/compressor/class_NullCompressor.php
19 * @license GNU GPL 3.0 or any newer version
20 * @link http://www.shipsimu.org
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 class NullCompressor extends BaseFrameworkSystem implements Compressor {
37 * Protected constructor
41 protected function __construct () {
42 // Call parent constructor!
43 parent::__construct(__CLASS__);
47 * Create a new compressor channel based a given compression handler
49 * @return $compressorInstance An instance of this class
51 public static final function createNullCompressor () {
53 $compressorInstance = new NullCompressor();
55 // Return the compressor instance
56 return $compressorInstance;
60 * Null compression stream
62 * @param $streamData Mixed non-object stream data
63 * @return $streamData The compressed stream data
64 * @throws InvalidObjectException If the stream is an object
66 public function compressStream ($streamData) {
67 if (is_object($streamData)) {
69 throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
72 // Return the compressed stream
77 * Null decompression stream
79 * @param $streamData Mixed non-object stream data
80 * @return $streamData The decompressed stream data
81 * @throws InvalidObjectException If the stream is an object
83 public function decompressStream ($streamData) {
84 if (is_object($streamData)) {
86 throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
89 // Return the decompressed stream
94 * Getter for the file extension of this compressor
96 * @return $string Returns always 'null'
98 public final function getCompressorExtension () {