private static void parse(InputStream in, BooleanQueryResultFormat format, QueryResultHandler handler,
ValueFactory valueFactory)
throws IOException, QueryResultParseException, QueryResultHandlerException,
UnsupportedQueryResultFormatException
{
QueryResultParser parser = QueryResultIO.createParser(format);
parser.setValueFactory(valueFactory);
parser.setQueryResultHandler(handler);
parser.parseQueryResult(in);
}