No subject


Fri Aug 6 17:04:17 PDT 2004


is closed when the parsing is completed.

If that's right, what closes the stream? SAXBuilder, or Xerces-J?
Though I tried to find an answer, I couldn't.

Chang-Ki Jeong
newchang at dreamwiz.com



-------------------------------------------------
DreamWiz Free Mail @ http://www.dreamwiz.com/
DreamSearch Click the world!!! http://search.dreamwiz.com/


--0-964404149-982909564=:86780
Content-Type: TEXT/HTML; CHARSET=US-ASCII

<HTML>
<BODY>

<BR>I noticed that the 'file' stream as an argument of builder.build(file)
<BR>in the 'FileReader' block was used in the previous 'BufferedReader'
<BR>block.
<BR>
<BR>So I put the some codes into the 'FileReader' block to check that
<BR>the 'file' stream is still opened.
<BR>
<BR>&nbsp;&nbsp;try {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;// build and output with FileReader cast to Reader
<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("\n\n******************\nbuild and output with FileReader cast to Reader. Ready? (hit 'Enter')");
<BR>&nbsp;&nbsp;&nbsp;&nbsp;System.in.read();System.in.read();
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;// added codes
<BR>&nbsp;&nbsp;&nbsp;&nbsp;int ch;
<BR>&nbsp;&nbsp;&nbsp;&nbsp;while((ch = file.read()) != -1) {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.print((char)ch);
<BR>&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;doc = builder.build((java.io.Reader)file);
<BR>&nbsp;&nbsp;&nbsp;&nbsp;fmt.output(doc, System.out);
<BR>&nbsp;&nbsp;} catch (Exception e) {
<BR>&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();
<BR>&nbsp;&nbsp;}
<BR>
<BR>The execution of the above program issued an error like this.
<BR>
<BR>&nbsp;&nbsp;&nbsp;java.io.IOException: Stream closed
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.InputStreamReader.ensureOpen(Unknown Source)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.InputStreamReader.read(Unknown Source)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.io.InputStreamReader.read(Unknown Source)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at RequestParser2.main(RequestParser2.java:77)
<BR>
<BR>From the situation I can guess that the stream used by SAXBuilder
<BR>is closed when the parsing is completed.
<BR>
<BR>If that's right, what closes the stream? SAXBuilder, or Xerces-J?
<BR>Though I tried to find an answer, I couldn't.
<BR>
<BR>Chang-Ki Jeong
<BR>newchang at dreamwiz.com
<BR>
<BR></BODY>
</HTML>

<BR>

<BR>
<BR>

<BR>
<a HREF="http://www.dreamwiz.com/" TARGET=_blank><img SRC="http://mail.dreamwiz.com/newchang/cgi-bin/receive_check.cgi?mailbox=Sent&uid=00000000000000000052,X00000&key=acdc34c892314fe1e56461fedf607f2a" BORDER="0"></a> <FONT SIZE=2><B>Your life on the net</FONT></B><br>
-------------------------------------------------<br>
DreamWiz Free Mail @ <a href="http://www.dreamwiz.com/" TARGET=_blank>http://www.dreamwiz.com/</a><br>
DreamSearch Click the world!!! <a href="http://search.dreamwiz.com/" TARGET=_blank>http://search.dreamwiz.com/</a><br>


--0-964404149-982909564=:86780--



More information about the jdom-interest mailing list