This method of the IntArrayOutputStream Class makes a copy of the array of integers represented by the IntArrayOutputStream object.
public synchronized int[] toIntArray();
Returns a copy of the integers represented by the output stream.