private String getHighlightedSection(final TextRange textRange) {
            try {
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                consumeHighlightedSection(textRange, baos::write);
                final String str = baos.toString(encoding);
                LOGGER.debug("str: [{}]", str);
                return str;
            } catch (final UnsupportedEncodingException e) {
                LOGGER.error(e.getMessage(), e);
                return e.getMessage();
            }
        }
Buffer for reading byte data with a provided encoding
stroom-pipeline/src/main/java/stroom/pipeline/reader/ReaderRecorder.java