use of org.apache.jena.riot.thrift.wire.RDF_StreamRow in project jena by apache.
the class BinRDF method apply.
/**
* Send the contents of a RDF-encoded Thrift file to an "action"
* @param protocol TProtocol
* @param action Code to act on the row.
*/
public static void apply(TProtocol protocol, Consumer<RDF_StreamRow> action) {
RDF_StreamRow row = new RDF_StreamRow();
while (protocol.getTransport().isOpen()) {
try {
row.read(protocol);
} catch (TTransportException e) {
if (e.getType() == TTransportException.END_OF_FILE)
break;
} catch (TException ex) {
TRDF.exception(ex);
}
action.accept(row);
row.clear();
}
}
Aggregations