diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-13 17:19:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-13 17:19:50 -0400 |
| commit | 3f438cdf7b991b77c9d80e07b71933240b726dc6 (patch) | |
| tree | f43b53ae3da95d74d856e444e72898e4515ebe0c /MediaBrowser.Common.Implementations/IO/MemoryStreamProvider.cs | |
| parent | 94ddbfd57f63cc484d232894bea1e2f183eaaf7e (diff) | |
| parent | 1c169b5b407c662a8ac0aa0f10bd37ce72e62901 (diff) | |
Merge pull request #2232 from MediaBrowser/beta
Beta
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); + } + } } |
