On 02/10/13 12:13, Norman Walsh wrote:
Andy Seaborne <[email protected]> writes:
Possible basis for a workaround:
@Override
public void run() {
LangRIOT parser ;
try {
parser = RiotReader.createParser(in, lang, fsname,
rdfInputStream);
}
catch (Exception ex) {
byte[] b = new byte[0] ;
InputStream in2 = new ByteArrayInputStream(b) ;
parser = RiotReader.createParser(in2, lang, fsname,
rdfInputStream);
}
parser.parse();
}
which silently discards the input.
Any comment on whether that's better or worse than my proposal to allow
calling .close() on the iterator to throw an exception from inside
the iterator?
Have you tried that?
I was trying to find a way that worked for the current release.
The trouble is that .close() is called by the consumer, not the
producer, and it does not put the endMarker on the pipe. Code needs to
call .finish, which is protected (so you could get at it via a wrapper).
Maybe add a "PipedRDFIterator.abort()" to call .finish().
Be seeing you,
norm