The clear method of the Response class removes any output that has been sent to a buffer.
public void clear();