@Override
    public boolean equals(final Object other) {
        if (other instanceof RingBuffer) {
            final RingBuffer buffer = (RingBuffer) other;
            int len1 = length;
            int len2 = buffer.length;

            if (len1 != len2) {
                return false;
            }
            for (int i = 0; i < len1; i++) {
                if (charAt(i) != buffer.charAt(i)) {
                    return false;
                }
            }
            return true;
        } else if (other instanceof CharSequence) {
            return length() == ((CharSequence) other).length() && toString().equals(other.toString());
        }
        return false;
    }
Moves the offset forward by the specified amount and reduces the
remaining length by the same amount.
stroom-util/src/test/java/stroom/util/xml/RingBuffer.java