コード例 #1
0
 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;
 }
コード例 #2
0
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $length = $reader->readInteger();
     $array = array();
     if (LOGGING) {
         Log::log(LoggingConstants::SERIALIZATION, "Reading array, size:" . $length);
     }
     $arrayType = new ArrayType($array);
     $parseContext->addReference($arrayType);
     for ($index = 0; $index < $length; $index++) {
         $array[] = AmfMessageFactory::readData($reader, $parseContext, null);
     }
     return $arrayType;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $capacity = $reader->readInteger();
     $properties = array();
     $anonymousObject = new AnonymousObject($properties);
     $parseContext->addReference($anonymousObject);
     while (TRUE) {
         $propName = $reader->readUTF();
         $obj = AmfMessageFactory::readData($reader, $parseContext, null);
         if (is_null($obj)) {
             break;
         }
         $properties[$propName] = $obj;
     }
     return $anonymousObject;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 public function read(FlashorbBinaryReader $reader, ParseContext $parseContext)
 {
     $properties = array();
     $anonymousObject = new AnonymousObject($properties);
     $parseContext->addReference($anonymousObject);
     while (true) {
         $propName = $reader->readUTF();
         $obj = null;
         $dataType = $reader->readByte();
         if ($dataType == Datatypes::REMOTEREFERENCE_DATATYPE_V1 && $propName != "nc") {
             $obj = 0;
             // must be an instance of Flash's Number
         } else {
             $obj = AmfMessageFactory::readData($reader, $parseContext, $dataType);
         }
         if (is_null($obj)) {
             break;
         }
         $properties[$propName] = $obj;
     }
     return $anonymousObject;
 }