What is the purpose of flush() in Java streams? What is the purpose of flush() in Java streams? java java