public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $refId = $reader->readVarInteger();
     if (($refId & 0x1) == 0) {
         return $parseContext->getReference($refId >> 1);
     }
     $classInfo = $this->getClassInfo($refId, $reader, $parseContext);
     $props = array();
     $obj = new AnonymousObject($props);
     $returnValue = $obj;
     if (!is_null($classInfo->getClassName()) && strlen($classInfo->getClassName()) > 0) {
         $returnValue = new NamedObject($classInfo->getClassName(), $obj);
     }
     $parseContext->addReference($returnValue);
     $propCount = $classInfo->getPropertyCount();
     for ($i = 0; $i < $propCount; $i++) {
         $props[$classInfo->getProperty($i)] = AmfMessageFactory::readData($reader, $parseContext, null);
     }
     if ($classInfo->getLooseProps()) {
         while (TRUE) {
             $propName = ReaderUtils::readString($reader, $parseContext);
             if (is_null($propName) || strlen($propName) == 0) {
                 break;
             }
             $props[$propName] = AmfMessageFactory::readData($reader, $parseContext, null);
         }
     }
     return $returnValue;
 }
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $refId = $reader->readVarInteger();
     if (($refId & 0x1) == 0) {
         return $parseContext->getReference($refId >> 1);
     }
     $dateTime = $reader->readDouble();
     $dateType = new DateType(new ORBDateTime($dateTime, 0));
     $parseContext->addReference($dateType);
     return $dateType;
 }
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $len = $reader->readVarInteger();
     if (($len & 0x1) == 0) {
         return $parseContext->getReference($len >> 1);
     }
     $len = $len >> 1;
     if ($len == 0) {
         return $this->parseString("");
     }
     $xmlStr = $reader->readUTF($len);
     $xmlType = $this->parseString($xmlStr);
     $parseContext->addReference($xmlType);
     return $xmlType;
 }
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $refId = $reader->readVarInteger();
     if (($refId & 0x1) == 0) {
         return $parseContext->getReference($refId >> 1);
     }
     $bytes = $reader->readBytes($refId >> 1);
     $objArray = array();
     $len = strlen($bytes);
     for ($i = 0; $i < $len; $i++) {
         $objArray[] = new NumberObject(ord($bytes[$i]));
     }
     $arrayType = new ArrayType($objArray);
     $parseContext->addReference($arrayType);
     return $arrayType;
 }
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $refId = $reader->readVarInteger();
     if (($refId & 0x1) == 0) {
         return $parseContext->getReference($refId >> 1);
     }
     $arraySize = $refId >> 1;
     $adaptingType = null;
     $container = null;
     while (true) {
         $str = ReaderUtils::readString($reader, $parseContext);
         if (is_null($str) || strlen($str) == 0) {
             break;
         }
         if (is_null($container)) {
             $container = array();
             $adaptingType = new AnonymousObject($container);
             $parseContext->addReference($adaptingType);
         }
         $container[$str] = AmfMessageFactory::readData($reader, $parseContext, null);
     }
     if (is_null($adaptingType)) {
         $container = array();
         $adaptingType = new ArrayType($container);
         $parseContext->addReference($adaptingType);
         for ($i = 0; $i < $arraySize; $i++) {
             $container[$i] = AmfMessageFactory::readData($reader, $parseContext, null);
         }
     } else {
         for ($i = 0; $i < $arraySize; $i++) {
             $obj = AmfMessageFactory::readData($reader, $parseContext, null);
             $container[(string) $i] = $obj;
         }
     }
     return $adaptingType;
 }
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $pointer = $reader->readUnsignedShort();
     return $parseContext->getReference($pointer);
 }
 public function read(DOMNode $element, ParseContext $parseContext)
 {
     /*int*/
     $refID = trim(strtolower($element->textContent));
     return $parseContext->getReference($refID);
 }