code: public static void exportToStream(final OutputStream outputStream, final Iterable<? extends NodeInterface> nodes, final Iterable<? extends RelationshipInterface> relationships, final Iterable<String> filePaths, final boolean includeFiles) throws FrameworkException {
  
  		try (final ZipOutputStream zos = new ZipOutputStream(outputStream)) {
  
  			final Set<String> filesToInclude = new LinkedHashSet<>();
  			if (filePaths != null) {
  
  				for (String file : filePaths) {
  
  					filesToInclude.add(file);
  				}
  			}
  
  			// set compression
  			zos.setLevel(6);
  
  			if (includeFiles) {
  
  				logger.info("Exporting files..");
  
  				// export files first
  				exportDirectory(zos, new File("files"), "", filesToInclude.isEmpty() ? null : filesToInclude);
  			}
  
  			// export database
  			exportDatabase(zos, new BufferedOutputStream(zos), nodes, relationships);
  
  			// finish ZIP file
  			zos.finish();
  
  			// close stream
  			zos.flush();
  			zos.close();
  
  		} catch (Throwable t) {
  
  			logger.warn("", t);
  
  			throw new FrameworkException(500, t.getMessage());
  		}
  	}
docs: Exports the given part of the structr database to the given output stream.
  
  @param outputStream
  @param nodes
  @param relationships
  @param filePaths
  @param includeFiles
  @throws FrameworkException