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); }
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); }
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); }