public void ensureCapacity(int minimumCapacity){
  if (minimumCapacity > value.length) {
    int ourMin=value.length * 2 + 2;
    enlargeBuffer(Math.max(ourMin,minimumCapacity));
  }
}

public void ensureCapacity ( int minimumCapacity ) { if ( minimumCapacity > value . length ) { int ourMin = value . length * 2 + 2 ; enlargeBuffer ( Math . max ( ourMin , minimumCapacity ) ) ; } }
ensures that the capacity of the buffer is at least equal to the specified minimum . if the current capacity of this string buffer is less than the argument , then a new internal buffer is allocated with greater capacity . the new capacity is the larger of : the minimumcapacity argument . twice the old capacity , plus 2 . if the minimumcapacity argument is nonpositive , this method takes no action and simply returns .
