]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/streams/raw_data/output/class_RawDataOutputStream.php
About to fix Base64EncodingModuloException (needed for debugging).
[hub.git] / application / hub / main / streams / raw_data / output / class_RawDataOutputStream.php
index f9c61f455d84f4919467202b90dbe097695197b5..7a4ec1845a4aa6ef604c921e2c67d29f09a0dcad 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * A RawDataOutputStream class
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
  * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009  Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,11 +50,17 @@ class RawDataOutputStream extends BaseStream implements OutputStreamable {
         *
         * @param       $data   The data (string mostly) to "stream"
         * @return      $data   The data (string mostly) to "stream"
-        * @todo        Do we need to do something more here?
         */
        public function streamData ($data) {
-               // Encode the data with BASE64 encoding
-               $data = base64_encode($data);
+               /*
+                * Encode the data with BASE64 encoding and put it in a "frame":
+                *
+                * [[S]] - Start marker
+                * [[E]] - End marker
+                */
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: data()=' . strlen($data) . ' - BEFORE!');
+               $data = BaseRawDataHandler::STREAM_START_MARKER . base64_encode($data) . BaseRawDataHandler::STREAM_END_MARKER;
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: data()=' . strlen($data) . ' - AFTER!');
 
                // Return it
                return $data;