File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bchitr

 
b panigrahy
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am parsing an XML file against a XSD with Apache XERCES parser.
I am using a FileReader object to pass it to the PARSE method of XERCES parser and after it finishes parsing, it's closing the STREAM of FILEREADER.

But, I would not like to close the STREAM as I would use the same READER further in the code.

Pleae, suggest me.
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would be the point of that? Surely the place you are reading from contains an XML document and nothing else? Which would mean there's nothing else to read from that Reader.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to re-use a Reader is false economy.

Instead, reuse the File object that represents to source file.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic