[jdom-interest] Re: Re: BUG in SAXBuilder

Joseph Bowbeer jozart at csi.com
Thu Feb 22 23:13:35 PST 2001


Xerces-J closes the input stream.

It's fairly typical for XML parsers to close the input stream when they
detect EOF.  Don't ask me why..

The faq entry about reading from a socket suggests some workarounds.

One suggestion is to protect the input stream from the parser, for example:

  class NoCloseInputStream extends FilterInputStream {
    public NoCloseInputStream(InputStream in) {
      super(in);
    }
    public void close() { /* nop */ }
  }

  new SAXBuilder().build( new NoCloseInputStream(in) );


----- original message -----



More information about the jdom-interest mailing list