private void MigrateFreespace(IFreespaceManager oldFreespaceManager)
        {
            IFreespaceManager newFreespaceManager = AbstractFreespaceManager.CreateNew(this,
                                                                                       ConfigImpl.FreespaceSystem());

            newFreespaceManager.Start(0);
            SystemData().FreespaceSystem(ConfigImpl.FreespaceSystem());
            InstallFreespaceManager(newFreespaceManager);
            AbstractFreespaceManager.Migrate(oldFreespaceManager, newFreespaceManager);
            _fileHeader.WriteVariablePart(this);
        }
        private bool FreespaceMigrationRequired(IFreespaceManager freespaceManager)
        {
            if (freespaceManager == null)
            {
                return(false);
            }
            byte readSystem       = _systemData.FreespaceSystem();
            byte configuredSystem = ConfigImpl.FreespaceSystem();

            if (freespaceManager.SystemType() == configuredSystem)
            {
                return(false);
            }
            if (configuredSystem != 0)
            {
                return(true);
            }
            return(AbstractFreespaceManager.MigrationRequired(readSystem));
        }
        internal virtual void ConfigureNewFile()
        {
            BlockSize(ConfigImpl.BlockSize());
            _fileHeader = FileHeader.NewCurrentFileHeader();
            SetRegularEndAddress(_fileHeader.Length());
            NewSystemData(ConfigImpl.FreespaceSystem(), ConfigImpl.IdSystemType());
            SystemData().ConverterVersion(Converter.Version);
            CreateStringIO(_systemData.StringEncoding());
            CreateIdSystem();
            InitializeClassMetadataRepository();
            InitalizeWeakReferenceSupport();
            GenerateNewIdentity();
            AbstractFreespaceManager blockedFreespaceManager = AbstractFreespaceManager.CreateNew
                                                                   (this);

            InstallFreespaceManager(blockedFreespaceManager);
            InitNewClassCollection();
            InitializeEssentialClasses();
            _fileHeader.InitNew(this);
            blockedFreespaceManager.Start(0);
        }