You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Model.IO;
|
|
|
|
|
|
|
|
|
|
namespace Emby.Server.Implementations.IO
|
|
|
|
|
{
|
|
|
|
|
public class MemoryStreamProvider : IMemoryStreamFactory
|
|
|
|
|
{
|
|
|
|
|
public MemoryStream CreateNew()
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MemoryStream CreateNew(int capacity)
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream(capacity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MemoryStream CreateNew(byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
return new MemoryStream(buffer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool TryGetBuffer(MemoryStream stream, out byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
buffer = stream.GetBuffer();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|