protected void doBooleanNoLinks(BooleanQueryResultFormat format, boolean input) throws IOException, QueryResultHandlerException, QueryResultParseException, UnsupportedQueryResultFormatException, QueryEvaluationException { ByteArrayOutputStream out = new ByteArrayOutputStream(4096); QueryResultIO.writeBoolean(input, format, out); out.flush(); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); boolean output = QueryResultIO.parseBoolean(in, format); assertEquals(output, input); }
/** * Tests that parsing a boolean without specifying a * {@link BooleanQueryResultHandler} does not throw any exceptions. * * @param format * @param input * @throws QueryResultParseException * @throws IOException */ protected void doBooleanNoHandler(BooleanQueryResultFormat format, boolean input) throws QueryResultParseException, IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(4096); QueryResultIO.writeBoolean(input, format, out); out.flush(); ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); BooleanQueryResultParser parser = QueryResultIO.createBooleanParser(format); assertEquals(input, parser.parse(in)); }
QueryResultIO.writeBoolean(value, BooleanQueryResultFormat.SPARQL, xmlOut); byte[] queryResult = xmlOut.toByteArray();
QueryResultIO.writeBoolean(value, BooleanQueryResultFormat.SPARQL, xmlOut); byte[] queryResult = xmlOut.toByteArray();