public SharpSerializer() // TODO: Is it possible to assigh Type to serializer, so it could speed up?
 {
     var settings = new Polenter.Serialization.SharpSerializerBinarySettings
     {
         Mode = BinarySerializationMode.Burst
     };
     _serializer = new Polenter.Serialization.SharpSerializer(settings);
 }
Ejemplo n.º 2
0
        public SharpSerializer() // TODO: Is it possible to assigh Type to serializer, so it could speed up?
        {
            var settings = new Polenter.Serialization.SharpSerializerBinarySettings
            {
                Mode = BinarySerializationMode.Burst
            };

            _serializer = new Polenter.Serialization.SharpSerializer(settings);
        }
Ejemplo n.º 3
0
 public SharpSerializer(TestingSystem context, IConfigSectionNode conf)
     : base(context, conf)
 {
     var settings = new Polenter.Serialization.SharpSerializerBinarySettings
       {
           Mode = BinarySerializationMode.Burst
       };
     m_Serializer = new Polenter.Serialization.SharpSerializer(settings);
 }
Ejemplo n.º 4
0
        public SharpSerializer(TestingSystem context, IConfigSectionNode conf)
            : base(context, conf)
        {
            var settings = new Polenter.Serialization.SharpSerializerBinarySettings
            {
                Mode = BinarySerializationMode.Burst
            };

            m_Serializer = new Polenter.Serialization.SharpSerializer(settings);
        }
Ejemplo n.º 5
0
        private void initialize(SharpSerializerBinarySettings settings)
        {
            // PropertiesToIgnore
            PropertyProvider.PropertiesToIgnore = settings.AdvancedSettings.PropertiesToIgnore;
            PropertyProvider.AttributesToIgnore = settings.AdvancedSettings.AttributesToIgnore;

            //RootName
            RootName = settings.AdvancedSettings.RootName;

            // TypeNameConverter)
            ITypeNameConverter typeNameConverter = settings.AdvancedSettings.TypeNameConverter ??
                                                   DefaultInitializer.GetTypeNameConverter(
                settings.IncludeAssemblyVersionInTypeName,
                settings.IncludeCultureInTypeName,
                settings.IncludePublicKeyTokenInTypeName);


            // Create Serializer and Deserializer
            Polenter.Serialization.Advanced.Binary.IBinaryReader reader = null;
            Polenter.Serialization.Advanced.Binary.IBinaryWriter writer = null;
            if (settings.Mode == BinarySerializationMode.Burst)
            {
                // Burst mode
                writer = new BurstBinaryWriter(typeNameConverter, settings.Encoding);
                reader = new BurstBinaryReader(typeNameConverter, settings.Encoding);
            }
            else
            {
                // Size optimized mode
                writer = new SizeOptimizedBinaryWriter(typeNameConverter, settings.Encoding);
                reader = new SizeOptimizedBinaryReader(typeNameConverter, settings.Encoding);
            }

            _deserializer = new BinaryPropertyDeserializer(reader);
            _serializer   = new BinaryPropertySerializer(writer);
        }