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

bchitr

 
b panigrahy
Greenhorn
Posts: 14
  • 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
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • 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: 13062
6
  • 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