[jdom-interest] passing doc through socket

Joseph Bowbeer jozart at csi.com
Wed Oct 18 14:28:31 PDT 2000


I've noticed this, too, using SAXBuilder from a servlet/socket input
stream.  I guessed the problem was on the parser-side, but haven't
investigated further.

One workaround is to read everything into a byte array and then read
from the byte-array input stream instead.

  protected void processRequest(HttpServletRequest req, ...
    //InputStream in = req.getInputStream(); XXX
    byte[] buf = new byte[req.getContentLength()];
    new DataInputStream(req.getInputStream()).readFully(buf);
    InputStream in = new ByteArrayInputStream(buf);


----- Original Message -----

Reply-To: <alex at ispfocus.com>
From: "Alex Brud" <alex at ispfocus.com>
To: <jdom-interest at jdom.org>
Date: Wed, 18 Oct 2000 14:49:37 +0200
Subject: [jdom-interest] passing doc through socket

hi all
i'm trying to path a document converted to outputStream through a
server-socket application.

to send the document im using (at the client end):
XMLOutputter outputter = new XMLOutputter();
outputter.output(doc,out) as 'out' == ItsSocket.getOutputStream;

to receve the stream , im using (at the server end):
DOMBuilder builder = new DOMBuilder();
doc = builder.build(itsSocket.getinputStream);

but it seems that the process is "stuck" when building the document.
the process never get beyong the builder line.

please help
thanks




More information about the jdom-interest mailing list