• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Response Doubt

 
sravanthi pulukuri
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Method to reterive an object to write binary data :

I thought it was only response.getOutputStream()
but it was also given as response.getWriter()
please help.
 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The method getWriter(), return a Writer that is a Wrapper of a OuputStream, this kind of class only admit text plain, meanwhile the other (getOutputStream() ) allow whaever type of data (binary, 010101010)

I dont know if i explain my self

Greetings
 
Rob Spoor
Sheriff
Pie
Posts: 20750
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say getWriter() is wrong because that only allows character data to be written, and the question clearly is about binary data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic