This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes PrintWriter  vs OutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "PrintWriter  vs OutputStream" Watch "PrintWriter  vs OutputStream" New topic
Author

PrintWriter vs OutputStream

samdeep aarzoo
Ranch Hand

Joined: Jun 09, 2005
Posts: 160
can anybody help me
what is the difference between PrintWriter and OutputStream
which should we use . which is better?
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
PrintWriter is only for character data and OutputStream for everything (binary data, character data).


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Alexandre Cervieri
Greenhorn

Joined: Aug 02, 2005
Posts: 27
In addition, you cannot use both PrintWriter and OutputStream. If you obtained one of them and try to get the other you will get a IllegalStateException. See also the following thread:
http://www.coderanch.com/t/170147/java-Web-Component-SCWCD/certification/servlet-getWriter-output-stream
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PrintWriter vs OutputStream
 
Similar Threads
why should we set response.setContentType before using PrintWriter or OutputStream?
Difference between PrintWriter and Output Stream.
PrintStream & PrintWriter
problem with PrintWriter
what is the difference between printStream and PrintWriter?