2021-02-08 16:51:19 +08:00
|
|
|
using System.IO;
|
|
|
|
using Microsoft.IO;
|
|
|
|
|
2021-11-13 02:01:03 +08:00
|
|
|
namespace BililiveRecorder.Flv.Tests
|
2021-02-08 16:51:19 +08:00
|
|
|
{
|
|
|
|
public class TestRecyclableMemoryStreamProvider : IMemoryStreamProvider
|
|
|
|
{
|
|
|
|
private static readonly RecyclableMemoryStreamManager manager
|
|
|
|
= new RecyclableMemoryStreamManager(32 * 1024, 64 * 1024, 64 * 1024 * 32)
|
|
|
|
{
|
|
|
|
MaximumFreeSmallPoolBytes = 64 * 1024 * 1024,
|
|
|
|
MaximumFreeLargePoolBytes = 64 * 1024 * 32,
|
|
|
|
};
|
|
|
|
|
2021-11-20 13:19:23 +08:00
|
|
|
public MemoryStream CreateMemoryStream(string tag) => manager.GetStream(tag);
|
2021-02-08 16:51:19 +08:00
|
|
|
}
|
|
|
|
}
|