public static char[] ensureCapacity(final char[] array,final int length,final int preserve){
  if (length > array.length) {
    final char t[]=new char[length];
    System.arraycopy(array,0,t,0,preserve);
    return t;
  }
  return array;
}

public static char [ ] ensureCapacity ( final char [ ] array , final int length , final int preserve ) { if ( length > array . length ) { final char t [ ] = new char [ length ] ; System . arraycopy ( array , 0 , t , 0 , preserve ) ; return t ; } return array ; }
ensures that an array can contain the given number of entries , preserving just a part of the array .
