public OnDemandQuery outStream(OutputStream outputStream) {

        this.outputStream = outputStream;
        if (outputStream != null && outputStream.getOutputEventType() == null) {
            outputStream.setOutputEventType(OutputStream.OutputEventType.CURRENT_EVENTS);
        }
        return this;
    }
Builder method to set an outPutStream to the on-demand query

@param outputStream outPutStream for the on-demand query
@return updated on-demand query
modules/siddhi-query-api/src/main/java/io/siddhi/query/api/execution/query/OnDemandQuery.java