• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

output stream to String in java

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i get some xml response using response.getoutputstream();

my code is here


my question is my save outputstream content into string ?

help me please
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at the code and the comments in it, it looks like you want to write out the serialized version of the "token" to a String? Is that correct? If yes, it should be easy enough, you don't need all that response.getOutputStream() and other code. Take a look at StringWriter class available in Java.
 
Durga Roobini
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:Looking at the code and the comments in it, it looks like you want to write out the serialized version of the "token" to a String? Is that correct? If yes, it should be easy enough, you don't need all that response.getOutputStream() and other code. Take a look at StringWriter class available in Java.



inside token the methodname and url calling is there XmlRpcSerialzer pre-defined class they use XmlRpcSerializer.serialize(Object value,Writer writer) return method as XmlRpcSerializer.serialize( token, writer );
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Durga Roobini wrote:[

inside token the methodname and url calling is there XmlRpcSerialzer pre-defined class they use XmlRpcSerializer.serialize(Object value,Writer writer) return method as XmlRpcSerializer.serialize( token, writer );



I'm sorry, I don't understand what you meant there. In my previous post what I hinted was at passing a StringWriter object as the second parameter to that serialize method.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic