Exemplo n.º 1
0
        // ReSharper disable once MethodOverloadWithOptionalParameter
        internal static object Deserialize(IByteBuffer buffer, SerializationMetadata metadata)
        {
            if (metadata != null)
            {
                ISerializator ser;
                if (buffer.GetUnsignedIntLE(buffer.ReaderIndex) == TgZipPackageId)
                {
                    buffer.SkipBytes(4);
                    ser = SerializationMap.GetSerializator(typeof(TgZipPacked).GetTypeInfo());
                }
                else
                {
                    ser = SerializationMap.GetSerializator(metadata.PropertyTypeInfo);
                }
                return(ser.Deserialize(buffer, metadata));
            }

            return(Deserialize(buffer, typeof(IObject).GetTypeInfo()));
        }