Package com.stardog.stark.query.io.binary

# Class BinarySelectQueryResultWriter

java.lang.Object
com.stardog.stark.query.io.binary.BinarySelectQueryResultWriter

All Implemented Interfaces:
  `BinaryQueryResultConstants`, `QueryResultWriter<BindingSet>`, `SelectQueryResultWriter`, `QueryResultHandler<BindingSet>`, `SelectQueryResultHandler`

public final class BinarySelectQueryResultWriter extends Object implements SelectQueryResultWriter, BinaryQueryResultConstants

`Writer` for `SelectQueryResult` in a binary format

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
See Also:
  - `QueryResultFormats.BINARY`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `BinarySelectQueryResultWriter.BinarySelectQueryResultWriterFactory`
  `Factory` for `BinarySelectQueryResultWriter`

- ## Field Summary

  ### Fields inherited from interface com.stardog.stark.query.io.binary.BinaryQueryResultConstants

  `BNODE_RECORD_MARKER, DATATYPE_LITERAL_RECORD_MARKER, DEFAULT_GRAPH_RECORD_MARKER, EMPTY_ROW_RECORD_MARKER, ERROR_RECORD_MARKER, FORMAT_VERSION, LANG_LITERAL_RECORD_MARKER, MAGIC_NUMBER, MALFORMED_QUERY_ERROR, NAMED_GRAPH_RECORD_MARKER, NAMESPACE_RECORD_MARKER, NULL_RECORD_MARKER, PLAIN_LITERAL_RECORD_MARKER, QNAME_RECORD_MARKER, QUERY_EVALUATION_ERROR, REPEAT_RECORD_MARKER, STATEMENT_RECORD_MARKER, TABLE_END_RECORD_MARKER, URI_RECORD_MARKER`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BinarySelectQueryResultWriter(OutputStream theWriter, Options theOptions)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `end()`
  Signal that query processing has completed
  `QueryResultFormat`
  `format()`
  The `format` this writer will serialize output in
  `void`
  `handle(BindingSet theBindings)`
  Handle a result to a query
  `void`
  `links(List<String> theLinks)`
  Handle the set of links from the result
  `void`
  `namespace(String thePrefix, String theIRI)`
  `void`
  `start()`
  Indicates that writing has begun.
  `void`
  `variables(List<String> theVars)`
  The variables in the projection of the query

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BinarySelectQueryResultWriter

    public BinarySelectQueryResultWriter(OutputStream theWriter, Options theOptions)

- ## Method Details

  - ### start

    public void start() throws ResultWritingFailed
    Indicates that writing has begun.
    Specified by:
      `start` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `start` in interface `QueryResultWriter<BindingSet>`
    Throws:
      `ResultWritingFailed` - if writing failed.

  - ### namespace

    public void namespace(@Nonnull String thePrefix, @Nonnull String theIRI) throws ResultWritingFailed
    Specified by:
      `namespace` in interface `QueryResultWriter<BindingSet>`
    Throws:
      `ResultWritingFailed`

  - ### variables

    public void variables(@Nonnull List<String> theVars)
    The variables in the projection of the query
    Specified by:
      `variables` in interface `SelectQueryResultHandler`
    Parameters:
      `theVars` - the variables
    See Also:
      - `SelectQueryResult.variables()`

  - ### handle

    public void handle(@Nonnull BindingSet theBindings) throws ResultWritingFailed
    Handle a result to a query
    Specified by:
      `handle` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `handle` in interface `QueryResultWriter<BindingSet>`
    Parameters:
      `theBindings` - the result
    Throws:
      `ResultWritingFailed`

  - ### end

    public void end() throws ResultWritingFailed
    Signal that query processing has completed
    Specified by:
      `end` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `end` in interface `QueryResultWriter<BindingSet>`
    Throws:
      `ResultWritingFailed`

  - ### links

    public void links(@Nonnull List<String> theLinks) throws ResultWritingFailed
    Handle the set of links from the result
    Specified by:
      `links` in interface `QueryResultHandler<BindingSet>`
    Specified by:
      `links` in interface `QueryResultWriter<BindingSet>`
    Parameters:
      `theLinks` - The links
    Throws:
      `ResultWritingFailed`
    See Also:
      - "link"

  - ### format

    @Nonnull public QueryResultFormat format()
    The `format` this writer will serialize output in
    Specified by:
      `format` in interface `QueryResultWriter<BindingSet>`
    Returns:
      the format