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> try {
<BR> // build and output with FileReader cast to Reader
<BR> System.out.println("\n\n******************\nbuild and output with FileReader cast to Reader. Ready? (hit 'Enter')");
<BR> System.in.read();System.in.read();
<BR>
<BR> // added codes
<BR> int ch;
<BR> while((ch = file.read()) != -1) {
<BR> System.out.print((char)ch);
<BR> }
<BR>
<BR> doc = builder.build((java.io.Reader)file);
<BR> fmt.output(doc, System.out);
<BR> } catch (Exception e) {
<BR> e.printStackTrace();
<BR> }
<BR>
<BR>The execution of the above program issued an error like this.
<BR>
<BR> java.io.IOException: Stream closed
<BR> at java.io.InputStreamReader.ensureOpen(Unknown Source)
<BR> at java.io.InputStreamReader.read(Unknown Source)
<BR> at java.io.InputStreamReader.read(Unknown Source)
<BR> 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