using System; using System.Buffers; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HaoYueNet.ServerNetwork.NetWork { public static class ArrayPoolManager { static ArrayPool instance = ArrayPool.Shared; /// /// 租用指定大小byte数组 /// /// /// public static byte[] RentByteArr(int lenght) { return instance.Rent(lenght); } /// /// 将数组归还给池 /// /// /// public static void ReturnByteArr(byte[] byteArr) { instance.Return(byteArr); } } }