protected static int growSize(int current, int requiredSize) {
    // Double until 64, then increase by 50% each time.
    int newCapacity = ((current < 64) ? ((current + 1) << 1) : ((current >> 1) * 3));
    // overflow?
    if (newCapacity < 0) {
      throw new OutOfMemoryError();
    }
    if (requiredSize > newCapacity) {
      newCapacity = requiredSize;
    }
    return requiredSize;
  }
protected static int growSize ( int current , int requiredSize ) { int newCapacity = ( ( current < 64 ) ? ( ( current + 1 ) << 1 ) : ( ( current > > 1 ) * 3 ) ) ; if ( newCapacity < 0 ) { throw new OutOfMemoryError ( ) ; } if ( requiredSize > newCapacity ) { newCapacity = requiredSize ; } return requiredSize ; }
Compute the size to grow to.

@param current Current size
@param requiredSize Required size
@return Size to allocate