code: private void resize(int s) {
          int[] n;
          int count;
  
          n = new int[s];
          count = (s < data.length)? s : data.length;
          System.arraycopy(data, 0, n, 0, count);
          data = n;
      }
docs: Changes data to have data.length >= s components. All data
  components that fit into the new size are preserved.
  @param   s   new data size wanted