private void grow(int minCapacity){
  int oldCapacity=buf.length;
  int newCapacity=oldCapacity << 1;
  if (newCapacity - minCapacity < 0)   newCapacity=minCapacity;
  if (newCapacity - MAX_ARRAY_SIZE > 0)   newCapacity=hugeCapacity(minCapacity);
  buf=Arrays.copyOf(buf,newCapacity);
}

private void grow ( int minCapacity ) { int oldCapacity = buf . length ; int newCapacity = oldCapacity << 1 ; if ( newCapacity - minCapacity < 0 ) newCapacity = minCapacity ; if ( newCapacity - MAX_ARRAY_SIZE > 0 ) newCapacity = hugeCapacity ( minCapacity ) ; buf = Arrays . copyOf ( buf , newCapacity ) ; }
increases the capacity to ensure that it can hold at least the number of elements specified by the minimum capacity argument .
