/** * * @param SerializationStreamReader $streamReader * @param unknown_type $instance * @throws SerializationException */ public static function deserialize(SerializationStreamReader $streamReader, $instance) { parent::deserialize($streamReader, $instance, self::getConsumingType($instance), 'HashSet'); // $consuming_type = 0; // HashSet // if ($instance instanceof HashSet) { // $consuming_type = 0; // } else if (is_array($instance)) { // $consuming_type = 1; // } else { // class_exists('SerializationException') // || require(GWTPHP_DIR.'/exceptions/SerializationException.class.php'); // throw new SerializationException("Error occurred while deserialize HashSet: " // ."HashMap_CustomFieldSerializer deserialize only array() or HashSet object, but given: " // .gettype($instance)); // } // // $size = $streamReader->readInt(); // // for ($i = 0; $i < $size; ++$i) { // /*Object*/ $obj = $streamReader->readObject(); // if (0 == $consuming_type) { // $instance->add($obj); // } else { // $instance[$i] = $obj; // } // // } }
/** * Enter description here... * * @param SerializationStreamReader $streamReader * @param array $instance (Vector<Object>) * @throws SerializationException */ public static function deserialize(SerializationStreamReader $streamReader, $instance) { parent::deserialize($streamReader, $instance, self::getConsumingType($instance), 'Vector'); // $size = $streamReader->readInt(); // for ($i = 0; $i < $size; ++$i) { // $obj = $streamReader->readObject(); // $instance[$i] = $obj; // } }