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) { $objectName = $reader->readUTF(); $reference = AmfMessageFactory::readData($reader, $parseContext, null); if (is_null($reference)) { return null; } $hostingEnvironmentID = $reader->readUTF(); return new RemoteReferenceObject($reference); }
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; }
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; }
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; }
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) { return AmfMessageFactory::readData($reader, new ParseContext(3), null); }