private void appendBufferContents(final CharBuffer messageBuffer,
                                      final Buffer buffer) {
        // Limit the amount of unmatched content we put in the msg in case
        // it is mahoosive.
        final int maxBuffLen = 200;
        final int tailLen = 10;
        final int headLen = maxBuffLen - tailLen;

        if (buffer.length() > maxBuffLen) {
            messageBuffer
                    .append(buffer.subSequence(0, headLen)
                            .toString()
                            .replace("\n", "\\n"))
                    .append("...TRUNCATED...")
                    .append(buffer.subSequence(buffer.length() - tailLen, tailLen)
                            .toString()
                            .replace("\n", "\\n"));
        } else {
            messageBuffer.append(buffer.unsafeCopy()
                    .toString()
                    .replace("\n", "\\n"));
        }
    }
Store data against a node for future retrieval by this node or by remote
reference from another node in the case of var elements.
stroom-pipeline/src/main/java/stroom/pipeline/xml/converter/ds3/DS3Parser.java