i plan to import all news data from another cms, and write some code to do that,but occurs OutOfMemoryException
[OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。]my code :
System.IO.MemoryStream.set_Capacity(Int32 value) +93
System.IO.MemoryStream.EnsureCapacity(Int32 value) +50
System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) +265
System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize) +41
System.IO.Stream.CopyTo(Stream destination) +130
Composite.Plugins.Data.DataProviders.MediaFileProvider.MediaFileProvider.AddNew(IEnumerable1 datas) +1320
1.<AddNew>b__e(IWritableDataProvider provider) +52
Composite.Data.Foundation.PluginFacades.<>c__DisplayClass10
using (FileStream source = new FileStream(localPath, FileMode.Open, FileAccess.Read))
{
file.Length = (int)source.Length;
file.MimeType = MimeTypeInfo.GetCanonicalFromExtension(ext);
using (Stream destination = file.GetNewWriteStream())
{
source.CopyTo(destination);
}
}
return DataFacade.AddNew<IMediaFile>(file, providerName);
when that happend , the IMediaFile is a flv