Java Equivalent to VB ReDim Preserve

Resizing arrays while preserving the existing contents is easily done in VB using ReDim Preserve.  In Java, you have other alternatives:

VB:
Dim YourArray() As Integer
...
ReDim Preserve YourArray(i)

Java:
int[] YourArray;
...
int[] temp = new int[i + 1];
if (YourArray != null)
    System.arraycopy(YourArray, temp, Math.min(YourArray.length, temp.length));
YourArray = temp;

If you need to convert from VB to Java and you are depending on the results being reliable and accurate, then you will want to have VB to Java Converter, the best VB to Java converter, at your fingertips.