mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-27 20:45:35 +08:00
31 lines
1019 B
C#
31 lines
1019 B
C#
using System.Diagnostics;
|
|
using System.IO;
|
|
using Microsoft.IO;
|
|
|
|
namespace BililiveRecorder.Flv.UnitTests
|
|
{
|
|
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,
|
|
};
|
|
|
|
static TestRecyclableMemoryStreamProvider()
|
|
{
|
|
//manager.StreamFinalized += (sender, e) =>
|
|
//{
|
|
// Debug.WriteLine("TestRecyclableMemoryStreamProvider: Stream Finalized");
|
|
//};
|
|
//manager.StreamDisposed += (sender, e) =>
|
|
//{
|
|
// // Debug.WriteLine("TestRecyclableMemoryStreamProvider: Stream Disposed");
|
|
//};
|
|
}
|
|
|
|
public Stream CreateMemoryStream(string tag) => manager.GetStream(tag);
|
|
}
|
|
}
|