FurinaImpact/FurinaImpact.Kcp/ArrayMemoryOwner.cs

23 lines
434 B
C#
Raw Normal View History

2023-12-09 03:45:08 +00:00
#if !NEED_POH_SHIM
using System.Buffers;
namespace FurinaImpact.Kcp
{
internal sealed class ArrayMemoryOwner : IMemoryOwner<byte>
{
private readonly byte[] _buffer;
public ArrayMemoryOwner(byte[] buffer)
{
_buffer = buffer ?? throw new ArgumentNullException(nameof(buffer));
}
public Memory<byte> Memory => _buffer;
public void Dispose() { }
}
}
#endif