public CharBuffer trimWhitespaceEnd() {
        while ((start < end) && (buffer[end - 1] <= SPACE)) {
            end--;
        }
        return this;
    }
Trims off whitespace from the end of the buffer.
stroom-util/src/main/java/stroom/util/CharBuffer.java