com.marklogic.xcc.examples

## Class OutputStreamInserter.DocBuilder

- java.lang.Object
- - com.marklogic.xcc.examples.OutputStreamInserter.DocBuilder

- All Implemented Interfaces:
    java.lang.Runnable
  Enclosing class:
    OutputStreamInserter

      public static class OutputStreamInserter.DocBuilder
      extends java.lang.Object
      implements java.lang.Runnable

  A simple dummy content generator which writes to an `OutputStream`. This is a brain-dead example that simply generates dummy content. A real implementation might be fetching rows from an SQL database or some other transient source. You should only use this approach if you don't have a better option. If the data can be written to a temp file or provided as a standard `InputStream` then one of the provided implementations in `ContentFactory` should be used. Note also that inserting content this way is not eligible for automatic error recovery and you can get in trouble if you don't manage threads properly.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocBuilder(java.io.OutputStream out, int lines)` Initialize this instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()` Entry point when the new `Thread` starts.

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

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

- - ### Constructor Detail

    - #### DocBuilder

          public DocBuilder(java.io.OutputStream out,
                            int lines)

      Initialize this instance.
      Parameters:
        `out` - An `OutputStream` to which content should be written.
        `lines` - How many lines to generate.

  - ### Method Detail

    - #### run

          public void run()

      Entry point when the new `Thread` starts. This is where your real business logic would go, ulitmately writing data to the `OutputStream`.
      Specified by:
        `run` in interface `java.lang.Runnable`

Copyright © 2025 MarkLogic Corporation. All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com