In this case, simply calling `flush()` is better since we need to flush out the whole contents in the current buffer in order to use the user input buffer directory for writing payloads.