/** * Serializes this {@link ProcessingResult} to an XML stream. The output includes all * documents, clusters and other attributes. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param stream the stream to serialize this {@link ProcessingResult} to. The stream * will <strong>not</strong> be closed. * @throws Exception in case of any problems with serialization */ public void serialize(OutputStream stream) throws Exception { serialize(stream, true, true); }
/** * Serializes this {@link ProcessingResult} to a byte stream. Documents and clusters * can be included or skipped in the output as requested. Other attributes are always * included. * <p> * This method is not thread-safe, external synchronization must be applied if needed. * </p> * * @param stream the stream to serialize this {@link ProcessingResult} to. The stream * will <strong>not</strong> be closed. * @param saveDocuments if <code>false</code>, documents will not be serialized. * Notice that when deserializing XML containing clusters but not * documents, document references in {@link Cluster#getDocuments()} will * not be restored. * @param saveClusters if <code>false</code>, clusters will not be serialized * @throws Exception in case of any problems with serialization */ public void serialize(OutputStream stream, boolean saveDocuments, boolean saveClusters) throws Exception { serialize(stream, saveDocuments, saveClusters, true); }