title: Java increase array by X size
body: <p>I need an array that I can determine its size from the start and if it has no more empty spaces then increase its size by <code>X</code>. For example:</p>
  
  <pre><code>int arraySize = 2;
  int[] intArray = new int[arraySize]; 
  int counter = 0;
  
  while(something){       
      if(counter == arraySize){
          // increase array size by X
      }
  
      intArray[counter] = counter;
      counter++;
  }
  </code></pre>
  
  <p>I checked <code>ArrayList</code> and <code>Vector</code> but I did not find a way.</p>