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) { $dataLength = $reader->readInteger(); $buffer = $reader->readBytes($dataLength); $dom = new DomDocument(); $dom->loadXML($buffer); return new XmlDataType($dom); }
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) { $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 static function readString(FlashorbBinaryReader $reader, ParseContext $parseContext) { $len = $reader->readVarInteger(); if (($len & 0x1) == 0) { return $parseContext->getStringReference($len >> 1); } $str = $reader->readUTF($len >> 1); if (strlen($str) == 0) { return $str; } $parseContext->addStringReference($str); return $str; }
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) { $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) { $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) { $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) { $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) { $bitShift = PHP_INT_SIZE * 8 - 29; return new NumberObject($reader->readVarInteger() << $bitShift >> $bitShift); // return new NumberObject(($reader->readVarInteger() << 3) >> 3); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { return new DateType(new ORBDateTime($reader->readDouble(), $reader->readUnsignedShort())); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { return new StringType($reader->readUTF()); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { $dataLength = $reader->readInteger(); $buffer = $reader->readBytes($dataLength); return new StringType(utf8_decode(buffer)); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { return new BooleanType($this->m_initialized ? $this->m_val : $reader->readBoolean()); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { $pointer = $reader->readUnsignedShort(); return $parseContext->getReference($pointer); }
public static function readData2(FlashorbBinaryReader $reader, ParseContext $parseContext, $readers) { if (LOGGING) { Log::log(LoggingConstants::DEBUG, "3: The version is " . $parseContext->getVersion()); } /*int*/ $type = $reader->readByte(); if (LOGGING) { Log::log(LoggingConstants::DEBUG, "The type is " . $type); } if ($type == 17) { return self::$V1READERS[$type]->read($reader, $parseContext); } else { return $readers[$type]->read($reader, $parseContext); } }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { $objectName = $reader->readUTF(); return new NamedObject($objectName, $this->m_objectReader->read($reader, $parseContext)); }
private function readBodyPart(FlashorbBinaryReader $reader) { Log::log(LoggingConstants::DEBUG, "Called"); $serviceURI = $reader->readUTF(); $responseURI = $reader->readUTF(); $bodyLength = $reader->readInteger(); Log::log(LoggingConstants::INFO, "Service:{$serviceURI}, responseURI:{$responseURI}, length: {$bodyLength}"); return new Body($serviceURI, $responseURI, $bodyLength, self::readData($reader, null, null)); }
public function read(FlashorbBinaryReader $reader, ParseContext $parseContext) { return new NumberObject($reader->readDouble()); }