Javatpoint Logo
Javatpoint Logo

ServletOutputStream class

ServletOutputStream class provides a stream to write binary data into the response. It is an abstract class.

The getOutputStream() method of ServletResponse interface returns the instance of ServletOutputStream class. It may be get as:

Methods of ServletOutputStream class

The ServletOutputStream class provides print() and println() methods that are overloaded.

  1. void print(boolean b){}
  2. void print(char c){}
  3. void print(int i){}
  4. void print(long l){}
  5. void print(float f){}
  6. void print(double d){}
  7. void print(String s){}
  8. void println{}
  9. void println(boolean b){}
  10. void println(char c){}
  11. void println(int i){}
  12. void println(long l){}
  13. void println(float f){}
  14. void println(double d){}
  15. void println(String s){}

Example of ServletOutputStream class

Example of ServletOutputStream class to write image

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA