This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ByteArrayOutputStream

 
Bob Moranski
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When we have a servlet that does persistent connection, why do we have to have aByteArrayOutput.writeTo(res.getOutputStream()) even after we already sent out the required info through res.getWriter().println(info)?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You appear to be doing a res.getOutputStream() after you already did a res.getWriter().
By my understanding of the API, that should cause a IllegalStateException to be thrown.
Why do you think "why do we have to"?
What is telling you that you have to do that?
Bill

------------------
author of:
 
Bob Moranski
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am so sorry. It was not res.getWriter() but a PrintWriter(new ByteArrayOutputStream(1024), true).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic