void writeFooter(final boolean roll) {
        LOGGER.debug("Writing footer - roll: {}, output: {}, writtenHeader: {}, footer: \n{}",
                roll, output, writtenHeader, footer);
        if (output != null) {
            if (writtenHeader) {
                try {
                    if (footer != null && footer.length > 0) {
                        // Write the footer.
                        output.write(footer);
                    }
                } catch (final IOException e) {
                    error(e.getMessage(), e);
                } finally {
                    writtenHeader = false;
                }
            }

            try {
                if (output.isZip()) {
                    output.endZipEntry();
                    if (roll) {
                        closeCurrentOutputStream();
                    }
                } else {
                    closeCurrentOutputStream();
                }
            } catch (final IOException e) {
                error(e.getMessage(), e);
                throw new UncheckedIOException(e);
            } catch (final RuntimeException e) {
                error(e.getMessage(), e);
                throw e;
            }
        }
    }
Method to allow subclasses to insert segment markers between records.
stroom-pipeline/src/main/java/stroom/pipeline/writer/AbstractAppender.java