private int capacity(int expectedMaxSize)
        {
            // Compute min capacity for expectedMaxSize given a load factor of 2/3
            int minCapacity = (3 * expectedMaxSize) / 2;

            // Compute the appropriate capacity
            int result;
            if (minCapacity > MAXIMUM_CAPACITY || minCapacity < 0)
            {
                result = MAXIMUM_CAPACITY;
            }
            else
            {
                result = MINIMUM_CAPACITY;
                while (result < minCapacity)
                    result <<= 1;
            }
            return result;
        }
Returns the appropriate capacity for the specified expected maximum size. Returns the smallest power of two
between MINIMUM_CAPACITY and MAXIMUM_CAPACITY, inclusive, that is greater than (3 * expectedMaxSize)/2, if
such a number exists. Otherwise returns MAXIMUM_CAPACITY. If (3 * expectedMaxSize)/2 is negative, it is
assumed that overflow has occurred, and MAXIMUM_CAPACITY is returned.
protostuff-core/src/main/java/io/protostuff/GraphProtostuffOutput.java