diff options
Diffstat (limited to 'MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs b/MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs index 364055283..c42947481 100644 --- a/MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs +++ b/MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs @@ -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); + } + } } |
