Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writer to InputStream or source

 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the xml stored in Writer object using VELOCITY. How can I convert this to an InputStream or InputSource to pass it to Document builder parse method for schema validation. Is there a better way?

Thanks
 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not write the file out to disk because of risk.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15280
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "XML stored in a Writer object"? A Writer in Java, if you're talking about writers in the standard Java I/O API, is not something that you can store data into. It is a class that helps you write data to some storage such as a file.

Can you make your question more clear by providing a piece of code?
 
Adam Teg
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out thanks. I meant a Writer java object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic