Search in sources :

Example 1 with SubtreePrinter

use of org.brackit.xquery.util.serialize.SubtreePrinter in project sirix by sirixdb.

the class IndexController method serialize.

/**
 * Serialize to an {@link OutputStream}.
 *
 * @param out the {@link OutputStream} to serialize to
 * @throws SirixRuntimeException if an exception occurs during serialization
 */
public void serialize(final OutputStream out) {
    try {
        final SubtreePrinter serializer = new SubtreePrinter(new PrintStream(checkNotNull(out)));
        serializer.print(mIndexes.materialize());
        serializer.end();
    } catch (final DocumentException e) {
        throw new SirixRuntimeException(e);
    }
}
Also used : SirixRuntimeException(org.sirix.exception.SirixRuntimeException) SubtreePrinter(org.brackit.xquery.util.serialize.SubtreePrinter) PrintStream(java.io.PrintStream) DocumentException(org.brackit.xquery.xdm.DocumentException)

Aggregations

PrintStream (java.io.PrintStream)1 SubtreePrinter (org.brackit.xquery.util.serialize.SubtreePrinter)1 DocumentException (org.brackit.xquery.xdm.DocumentException)1 SirixRuntimeException (org.sirix.exception.SirixRuntimeException)1