What is the difference between PrintStream and PrintWriter? They have many methods in common due to which I often mix these two classes up. Moreove
PrintStream
PrintWriter
Since JDK 1.4 it's possible to specify the character encoding for a PrintStream. Thus, the differences between PrintStream and PrintWriter are only about auto flushing behavior and that a PrintStream cannot wrap a Writer.