コード例 #1
0
        public static char[] RentBuffer(IJsonBufferPool<char> bufferPool, int minSize)
        {
            if (bufferPool == null)
            {
                return new char[minSize];
            }

            return bufferPool.RentBuffer(minSize);
        }
コード例 #2
0
        public static char[] RentBuffer(IJsonBufferPool <char> bufferPool, int minSize)
        {
            if (bufferPool == null)
            {
                return(new char[minSize]);
            }

            char[] buffer = bufferPool.RentBuffer(minSize);
            return(buffer);
        }
コード例 #3
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);
        }
コード例 #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);
        }