Here we will list all the differences between PrintWriter and ServletOutputStream:
PrintWriter
|
ServletOutputStream
|
It’s a character stream (useful for text data).
|
It’s a byte stream (useful for graphical data).
|
It provide getWriter() method.
|
It provide getOutputStream() method.
|
It does character encoding for ASCII / Unicode
characters.
|
It does not perform any character encoding because
it if meant for binary data.
|
It’s a Concrete class.
|
It’s Abstract class.
|
Its performance is little slow because of
character conversion.
|
Its performance is fast because no data conversion
takes place.
|
Example :
PrintWriter out = response.getWriter();
out.println("Welcome User");
|
Example :
ServletOutputStream out =
resonse.getOutputStream();
out.write(barray);
|
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.


Ziyyara's online tutors in Jaipur are well-versed with advanced tools like virtual whiteboard to deliver 1-on-1 live online tuition in Jaipur at the comfort of home.
ReplyDeleteCall Our Experts :- +91-9654271931