mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
30 lines
666 B
C#
30 lines
666 B
C#
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;
|
|
}
|
|
}
|
|
}
|