This method of the IntArrayOutputStream Class shrinks the storage of the IntArrayOutputStream object to the requested capacity. If the requested capacity is greater than or equal to the capacity of the output stream, the capacity of the output stream remains unchanged.
public synchronized int reduceCapacity(int capacity);
Returns the actual capacity of the output stream.
capacity | The maximum required capacity of the output stream. |
ArrayIndexOutOfBoundsException if the number of integers currently in the output stream exceeds the requested capacity.