1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<HTML>
<HEAD>
<TITLE>Pull Parser 2 FAQ
</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Aleksander Slominski [aslom@extreme.indiana.edu]">
</HEAD>
<BODY BGCOLOR="white">
<H1>Pull Parser 2 FAQ</H2><P>
<h2>How to access the latest source code?</h2>
<p>
The latest packaged releases are available at http://www.extreme.indiana.edu/soap/
and the latest source (if you want to be on the cutting edge) can now
be obtained now from anonymous CVS at:
<pre>
cvs -d :pserver:anonymous@cvs.extreme.indiana.edu:/l/extreme/cvspub login
CVS password: cvsanon
cvs -d :pserver:anonymous@cvs.extreme.indiana.edu:/l/extreme/cvspub co xsoap-java/PullParser
</pre>
<h2>Why XPP blocks when reading from input stream such as socket?</h2>
<p><strong>NOTE:</strong>pleasue use XPP version 2.1.8 or higher
- in previous version there is ogg-by-one buffering bug.
<p>XPP is a streaming parser however it depends on Reader to provide data in timely manner.
The current JDK implementattion of InputStreamReader will try to read 8KB into internal buffer
<strong>unless</strong> InputStream.available() function returns 0
(this behavior can not be overriden).
<p>Therefore it is necessary to use a wrapper around InputStream to make sure that
InputStreamReader will return as soon as data is available, for example:
<pre>
public class NoBufferingInputStream
extends FilterInputStream {
public NoBufferingInputStream(InputStream in) {
super(in);
}
public int available() { return 0; };
}
</pre>
<p>then one would use following construct to create Reader:
<pre>
InputStream socketInput = ...;
xpp.setInput(new InputStreamReader(
new NoBufferingInputStream(socketInput)));
</pre>
<p>[<a href="../README.html">Back To Pull Parser 2 Documentation</a>]<p>
<HR>
<address><a href="aslom@extreme.indiana.edu">Aleksander Slominski</a><address>
</BODY>
</HTML>
|