예제 #1
0
        private byte[] SaveLoaderToBytes(ILegacyDataLoader loader)
        {
            Contracts.CheckValue(loader, nameof(loader));

            using (var stream = new MemoryStream())
            {
                LoaderUtils.SaveLoader(loader, stream);
                return(stream.GetBuffer());
            }
        }
            protected ILegacyDataLoader CreateAndSaveLoader(Func <IHostEnvironment, IMultiStreamSource, ILegacyDataLoader> defaultLoaderFactory = null)
            {
                var loader = CreateLoader(defaultLoaderFactory);

                if (!string.IsNullOrWhiteSpace(ImplOptions.OutputModelFile))
                {
                    using (var file = Host.CreateOutputFile(ImplOptions.OutputModelFile))
                        LoaderUtils.SaveLoader(loader, file);
                }
                return(loader);
            }
 protected void SaveLoader(ILegacyDataLoader loader, string path)
 {
     using (var file = Host.CreateOutputFile(path))
         LoaderUtils.SaveLoader(loader, file);
 }