This method of the IntArrayOutputStream Class reduces the capacity of the IntArrayOutputStream object to the number of integers currently in the output stream.
public synchronized void shrinkToFit();