@Override
    public String toString() {
        if (offset + length <= buffer.length) {
            return new String(buffer, offset, length);
        } else {
            final char[] chars = toCharArray();
            return new String(chars, 0, chars.length);
        }
    }
True if the length of the buffer is 0 or that all content is whitespace.
stroom-pipeline/src/main/java/stroom/pipeline/xml/converter/ds3/RingBuffer.java