Question about .available()

flush is for the output buffer only.

This is not true as the posted code from SoftwareSerial show. It clear the input buffer only.