@Override
    public void characters(final char[] ch, final int start, final int length) throws SAXException {
        super.characters(ch, start, length);
        try {
            int pos = start;
            for (int i = start; i < start + length; i++) {
                final char c = ch[i];
                if (c == '\n') {
                    final int nextPos = i + 1;
                    final int len = nextPos - pos;

//                    final String str = new String(ch, pos, len);

                    borrowDestinations(header, footer);
                    getWriter().write(ch, pos, len);
                    pos = nextPos;
                    returnDestinations();
                }
            }

            final int len = length - pos;
            if (len > 0) {
                borrowDestinations(header, footer);

//                final String str = new String(ch, pos, len);

                getWriter().write(ch, pos, len);
            }

        } catch (final IOException e) {
            throw ProcessException.wrap(e);
        }
    }
Writes characters.

@param ch     An array of characters.
@param start  The starting position in the array.
@param length The number of characters to use from the array.
@throws org.xml.sax.SAXException The client may throw an exception during processing.
@see stroom.pipeline.filter.AbstractXMLFilter#characters(char[],
int, int)
stroom-pipeline/src/main/java/stroom/pipeline/writer/TextWriter.java