There isn't enough context to answer.
If the code you posted is in a
servlet, for example, you would just change it to write to the servlet's output stream instead of to that file.
Or if you wanted to have Adobe Reader (not the browser) start up and display that file after you wrote it, then you would use the java.awt.Desktop class to do that.
If neither of those guesses is right, then provide more information about your question.