aspose file tools*
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 Spring in Action this week in the Spring 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