private void replaceTailBuffer(byte[] buf, int ofs, int length) {
        System.arraycopy(buf, ofs + length - tailSize, tailBuffer, 0, tailSize);
        currentIndex = 0;
    }
Replaces the content of the internal tail buffer by the last portion of
the given buffer. This method is called if a buffer was read from the
underlying stream whose length is larger than the tail buffer.

@param buf    the buffer
@param ofs    the start offset in the buffer
@param length the number of bytes to be copied
tika-core/src/main/java/org/apache/tika/io/TailStream.java