22 lines
434 B
C#
22 lines
434 B
C#
#if !NEED_POH_SHIM
|
|
|
|
using System.Buffers;
|
|
|
|
namespace NahidaImpact.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
|