public static void ReturnBuffer(IJsonBufferPool <char> bufferPool, ref char[] buffer)
        {
            if (bufferPool == null)
            {
                buffer = null;
                return;
            }

            bufferPool.ReturnBuffer(ref buffer);
        }
예제 #2
0
        public static void ReturnBuffer(IJsonBufferPool<char> bufferPool, ref char[] buffer)
        {
            if (bufferPool == null)
            {
                buffer = null;
                return;
            }

            bufferPool.ReturnBuffer(ref buffer);
        }
        public static void EnsureBufferSize(IJsonBufferPool <char> bufferPool, int size, ref char[] buffer)
        {
            if (bufferPool == null)
            {
                buffer = new char[size];
                return;
            }

            if (buffer != null)
            {
                bufferPool.ReturnBuffer(ref buffer);
            }

            buffer = bufferPool.RentBuffer(size);
        }
예제 #4
0
        public static void EnsureBufferSize(IJsonBufferPool<char> bufferPool, int size, ref char[] buffer)
        {
            if (bufferPool == null)
            {
                buffer = new char[size];
                return;
            }

            if (buffer != null)
            {
                bufferPool.ReturnBuffer(ref buffer);
            }

            buffer = bufferPool.RentBuffer(size);
        }