private void appendBuf(byte[] buf, int ofs, int length) {
        if (length >= tailSize) {
            replaceTailBuffer(buf, ofs, length);
        } else {
            copyToTailBuffer(buf, ofs, length);
        }

        bytesRead += length;
    }
Adds the content of the given buffer to the internal 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