|
|
|
@ -1,15 +1,10 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Common.IO;
|
|
|
|
|
using Microsoft.IO;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Common.Implementations.IO
|
|
|
|
|
{
|
|
|
|
|
public class MemoryStreamProvider : IMemoryStreamProvider
|
|
|
|
|
public class RecyclableMemoryStreamProvider : IMemoryStreamProvider
|
|
|
|
|
{
|
|
|
|
|
readonly RecyclableMemoryStreamManager _manager = new RecyclableMemoryStreamManager();
|
|
|
|
|
|
|
|
|
@ -28,4 +23,22 @@ namespace MediaBrowser.Common.Implementations.IO
|
|
|
|
|
return _manager.GetStream("RecyclableMemoryStream", buffer, 0, buffer.Length);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class MemoryStreamProvider : IMemoryStreamProvider
|
|
|
|
|
{
|
|
|
|
|
public MemoryStream CreateNew()
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MemoryStream CreateNew(int capacity)
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream(capacity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MemoryStream CreateNew(byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream(buffer);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|