public void move(int increment) {
        offset += increment;
        length -= increment;

        if (length < 0) {
            // Make sure the length can't ever be less than 0.
            offset += length;
            length = 0;
        } else if (length > buffer.length) {
            // Make sure the length can't ever be greater than the buffer
            // length.
            offset -= buffer.length - length;
            length = buffer.length;
        }

        offset = offset % buffer.length;
        if (offset < 0) {
            offset = buffer.length + offset;
        }
    }
Moves the offset forward by the specified amount and reduces the
remaining length by the same amount.
stroom-pipeline/src/main/java/stroom/pipeline/xml/converter/ds3/RingBuffer.java